Everything posted by AGBrooks
-
Jquery function killing page load time
Yeah, I got the code sorted with a setInterval. Job done..!
-
Jquery function killing page load time
One thing I forgot to ask is about the loop I put in there. It was intentional, but is that a 'no-no' all the same..? I figured as it's actually doing something it would be okay...
-
Jquery function killing page load time
Hi everyone. I'm putting together an image fader [more than a slider] that has an overlapping content div [that does in fact slide] However, I'm getting a really poor page load time when I call back the function inside itself, so as to repeat it. This delay is screwing up my animation delays, etc... Any way, I'll show you guys the code: $(document).ready(function() { //Execute slideShow, set 4 seconds for each images slideShow(4000); overlap(4000); }); function overlap() { $('#overlap').delay(500).animate({"width":900,}, 500) .delay(3000).animate({"width":2600,},500) .animate({"right":1300,},500) .animate({"height":0,}) .animate({"right":0,}) .animate({"width":0,}) .animate({"height":512,}) overlap() } function slideShow(speed) { //Set opacity of all images to 0 $('ul.slideshow li').css({opacity: 0.0}); //Get first image and display it (set it to full opacity) $('ul.slideshow li:first').css({opacity: 1.0}).addClass('show'); //Call gallery function to run slideshow var timer = setInterval('gallery()',speed); } function gallery() { //if no IMGs have show class, grab first image var current = ($('ul.slideshow li.show')? $('ul.slideshow li.show') : $('#ul.slideshow li:first')); //speed issue if(current.queue('fx').length == 0) { //Get next image, if it reached end of slideshow, rotate back to first var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first')); //Set fade for next image, show class has higher z-index next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000); //Hide current image current.animate({opacity: 0.0}, 1000).removeClass('show'); } } If anyone has any ideas they would be appreciated. Other than sloppy syntax/general poor coding I keep looking at the doc ready function and thinking it might be the sneaky little culprit... Thanks..!
-
Hide Elements with PHP..?
Yep, I went with that very solution in the end. Never would have thought it could be as simple as putting html between php tags..! Thanks..!
-
Hide Elements with PHP..?
Thank you..! I thought I was being a complete moron not picking this up almost instantly - especially, as you say, considering the similar structure... I was wondering about targeting CSS as well - that's good to know..! Think I will give that a look. Thanks again...
-
Hide Elements with PHP..?
So are there actually show/hide functions in php, or will I have to make one [i haven't come across any while looking]..? Forgive me, I was told I should have no problems with php as I'm comfortable with javascript, but it feels like that's just making it worse in these early stages...
-
Hide Elements with PHP..?
I was hoping so. Could you give us an example in context as far as the hide/show side of things go with php..? I get the rest, but I'm completely new to php, and it's the hiding/showing side of things I'm not quite sure about...
-
Hide Elements with PHP..?
I need to display a nav menu on every page except the home page [don't ask me why - it's not my design]. Question is, can I hide an element with PHP as you would with js/jq..? As the url is the obvious variable I figure I may as well do it server-side if possible... Thanks..!
-
New Web design hopeful
HTML will take no time. With CSS I would recommend getting a strong grip on positioning, floats and selectors. It won't take all that long at all, but you'll be well on your way by then. You mean Java or javascript..? With HTML, CSS/CSS3, and javascript to a decent level you'll be employable, plus after js you'll have opened the door to other similar programming languages - jQuery [basically javascript+] and PHP, etc... HTML dog is waaayy better than w3schools, as mentioned, for learning [though w3schools is a great resource to double check things already learned]. Would also recommend Design Shack, A list Apart, and CSS-tricks for freebies. Also check this little nugget out: http://www.codecademy.com
-
CSS float Problem
When every item in a div is floated the parent div will collapse. The empty div is one option, but it's a bit outdated. Have a look at two things - floats in detail to learn a little more about how they behave - and the clearfix options that are available to you and what positives/negatives they each have. A google search will suffice, and I could almost guarantee that sites like A List Apart and Design Shack, etc will cover both these in detail. Floats and positioning are two things really worth looking at in detail...
-
Reset on submit
Looks like I had my echoes and vars the wrong way round. Couldn't help but think the echo needed to be in the else statement to be activated. Got a looong way to go with this stuff...
-
Reset on submit
Rather than start another topic, I'll ask here. What's the story with styling echos/prints with CSS - is it possible, and if so, advisable..? Basically I want to control the layout, colour, etc. of echoes [eg: "please enter a valid email address"] that prompt depending on validation. I'll put my first attempt below, but I'm completely stabbing in the dark, with basically no PHP knowledge, so I could just be wasting my time. Thanks..! My idea was: Echo a variable [assigned the relevant prompt] if validation comes back negative. else { echo $warning_one; Then assign the variables within a div to give me a CSS target. <div class="warnings"> <p><?php $warning_one = "please enter your name" ?></p> Needless to say this doesn't work. The code runs as valid PHP, but I can't style the strings.
-
Bold Hover on Horizontal Nav
The client isn't the issue. We advised them against it, and they accepted it. It just bugged me that I swore I'd seen a solution to this just weeks ago and couldn't remember where...
-
Reset on submit
My bad. Only meant to bold that echo to show where it was placed. If anyone knows of any particularly good resources for learning php, they would be appreciated. Think this will take me a while. PS: noted re: "Please use the code button or tags to format your code." edit. Will do...
-
Reset on submit
Hmm, I'm having trouble getting the 'Thank you' message to appear on page refresh. Is there a way I can get the echo to occur with/just after page refresh..? I'm sorry, my brain is going to need time to get used to the programming way of thinking... This was my lame attempt: <?php if (isset($_POST['submit'])) { $to = "email@email.co.uk"; $subject = "Visitor Message"; $name_field = $_POST['name']; $email_field = $_POST['email']; $number_field = $_POST['number']; $message = $_POST['message']; $body = "From: $name_field\n E-Mail: $email_field\n Phone Number: $number_field\n Message: $message"; if (!$email_field == "") { mail($to, $subject, $body); header ("Location: http://dev.site.com/contact-us.htm"); [b]echo "Thank you for your message, $to will get back to you as soon as possible";[/b] } else { echo "Please enter all your details to send message."; } } } ?>
-
Reset on submit
It does..? I asked that question and was told no. One of us got the wrong end of the stick I guess, prob me. Anyway, I'll give it a go. Thanks..!
-
Bold Hover on Horizontal Nav
Good call. Would work if I was dealing with buttons of equal length in nav. Unfortunately we're talking a text-only nav which leaves unequal, visible space between the links once you apply the width...
-
Just another member
Thanks... just realised I don't seem to be getting email notifications when someone replies to a topic I've started. Checked the settings and all seems to be in order. Not the end of the world, just a personal preference... Thanks again.
-
Bold Hover on Horizontal Nav
Sorry, I wasn't very clear. The problem is that when when you hover over a link with a:hover bold styled to it, you get movement on the nav menu as the font increases in size. I had a play with this issue a while back, but couldn't come up with a clean solution. Stumbled across one recently on a tut, but I can't remember where...
-
Reset on submit
Woops, I should have mentioned that. Redirecting to the same page would be fine, that was my first idea. But then I have the problem of displaying a 'thanks'/'your message has been sent' notification. Again, without javascript I can't see a solution, but I'm new to back end development so I don't really know what is/isn't doable at this stage. One of our php programmers says I should just create a clone of the same contact page and put a thanks message in place of the form. It's a pretty nasty solution to be fair, but I haven't come up with anything better...
-
Bold Hover on Horizontal Nav
I'd long given up on the idea of bold hover on navs until 1] I stumbled across a tutorial that cracked it, and 2] a customer recently requested it. Obviously I can't find the tut again or remember what the solution was. would be nice to call back the client and tell him I came up with a genius solution. Anyone else seen/come up with a way round this..? Thanks...
-
Reset on submit
Hi guys, If possible, I'm after a reset data PHP function, upon submit of contact form info. Redirecting the user isn't an option and I've been told not to avoid javascript if I can. I'm not too clued up on with PHP so I'm not sure how to go about it, or if it's doable at all. I'll post the code I've got so far, in case it's of any help. Sorry to ask a form related question, but it's not the form itself I'm stuck on so hopefully won't upset too many people... Thanks..! <?php if (isset($_POST['submit'])) { $to = "address@address.co.uk"; $subject = "Visitor Message"; $name_field = $_POST['name']; $email_field = $_POST['email']; $number_field = $_POST['number']; $message = $_POST['message']; $body = "From: $name_field\n E-Mail: $email_field\n Phone Number: $number_field\n Message: $message"; if (!$email_field == "") { echo "Thank you for your message, $to will get back to you as soon as possible"; mail($to, $subject, $body); } else { echo "Please enter all your details to send message."; } } } ?>
-
Just another member
Hello everybody... Been using another forum until now, but [without mentioning names] I didn't find it particularly helpful/pleasant place, so I figured it's time for a change...