4388 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 more
Ivor Envato team says

js selectors != css selectors

I know that.

3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says


js selectors != css selectors
I know that.

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

2333 posts
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Helped several times protecting Envato Market against copyright violations
+5 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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
wpCanyonThemes says
4388 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 more
Ivor Envato team 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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
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. :)

4388 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 more
Ivor Envato team 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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by