- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
duotive said
js selectors != css selectors
I know that.
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 1 and 9 items
- Europe
- Exclusive Author
- Has been a member for 2-3 years
- Item was Featured
- Referred between 100 and 199 users
IvorPadilla said
duotive saidI know that.
js selectors != css selectors
than you can be sure that it will work on ie7
no problem there
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Item was Featured
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Europe
- Exclusive Author
- Has been a member for 4-5 years
- Referred between 100 and 199 users
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
http://api.jquery.com/focusout/
You’re welcome. 
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
wpCanyonThemes said
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();
});IvorPadilla said
wpCanyonThemes said
http://api.jquery.com/focusout/ You’re welcome.![]()
Thanks I didn’t knew about the
focusoutevent; 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. 
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
Hey wpCanyonThemes thanks a lot man I’m now using var j = jQuery.noConflict(); and thanks for the rest man now is working perfectly.
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.
