4268 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

js selectors != css selectors

I know that.

3007 posts
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 100 and 199 users
+2 more
duotive says


js selectors != css selectors
I know that.

than you can be sure that it will work on ie7 :) no problem there

2317 posts
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 100 and 199 users
+1 more
CreativeMilk says

He Ivor, i have made the same snippet a while back, i think it whas for an project or so…....have to digg true my files

1383 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says
4268 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

http://api.jquery.com/focusout/ You’re welcome. :)

Thanks I didn’t knew about the focusout event; I did this and is looking great:

jQuery('a#open').click(function () {
    jQuery('a#open').fadeOut();
    jQuery('#search').stop().animate({ "top": "0px" }, "slow").append('<a href="#" id="close">Close</a>');
});
// The 'close' link is generated dinamically, I have to use the .live() method
jQuery('a#close').live('click', function() {
    jQuery('#search').stop().animate({ "top": "-55px" }, "slow");
    jQuery('a#open').fadeIn();
    jQuery('a#close').fadeOut();    
});
1383 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says


http://api.jquery.com/focusout/ You’re welcome. :)

Thanks I didn’t knew about the focusout event; I did this and is looking great:

jQuery('a#open').click(function () {
    jQuery('a#open').fadeOut();
    jQuery('#search').stop().animate({ "top": "0px" }, "slow").append('<a href="#" id="close">Close</a>');
});
// The 'close' link is generated dinamically, I have to use the .live() method
jQuery('a#close').live('click', function() {
    jQuery('#search').stop().animate({ "top": "-55px" }, "slow");
    jQuery('a#open').fadeIn();
    jQuery('a#close').fadeOut();    
});

Use

jQuery(document).ready(function($){

});

Notice the $ in the function() part. That way you don’t have to use jQuery all the time, you can use $. Or anything else, if you put “hellyeah” inside () you can use hellyeah(‘selector’)...

Also you can use $(this) in the first event instead of $(‘a#open’) and the same for the $(‘a#close’) in the second one.

Also from what i can see, it will continue to create new instances of the anchor with id #close every time you click the a#open. Either use jQuery(‘a#close’).fadeOut().remove(); in the second event or just add the a#close to be there by default with display:none, remove the part for appending it and use fadeIn() in the first event.

Hope i helped. :)

4268 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Microlancer Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

Hey wpCanyonThemes thanks a lot man I’m now using var j = jQuery.noConflict(); and thanks for the rest man now is working perfectly.

1383 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says

You’re welcome. :)

Before i started my blog on WordPress development i had a little blog (70K pageviews per month) on jQuery development, so whenever you have a prob with jQuery post it up on the forum and i’ll try to help you. Same goes for everyone else.

by
by
by
by
by
by