Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, the live() function in jQuery has been depricated for a while now and has been removed in the latest versions (1.10 included with WordPress these days does not have it anymore) so that is not an option anymore… The function on() replaces it.

    Try this code in a text widget or in your themes footer.php file:

    <script type="text/javascript">
    jQuery(document).on('click', easy_fancybox_handler );
    </script>

    But be aware this is an ‘expensive’ work-around since it fires up the fancybox init code on each click…

    Thread Starter xs650

    (@xs650)

    I am OK with ‘expensive’
    I only need it on one switcher panel on the site

    I have been trying to get this work with no luck.

    I found this example of it working, not with the plugin but with the Jquery Library
    http://www.picssel.com/playground/jquery/jQueryONreplacingContent_07mar12.html

    I am OK with ‘expensive’
    I only need it on one switcher panel on the site

    The thing is that this code will take toll on EVERY click on your site, not only the ones in that one switcher panel…

    I found this example of it working, not with the plugin but with the Jquery Library
    http://www.picssel.com/playground/jquery/jQueryONreplacingContent_07mar12.html

    The example suggests using “focusin” instead of “click”. This will probably not work in combination with jQuery(document)

    But if you know this switcher panel (wrapper) div’s ID or class, then you can make the snippet work with focusin and at the same time make it much less ‘expensive’ by limiting the call to that ID or class. For example:

    <script type="text/javascript">
    jQuery('#switcherpanel').on('focusin', easy_fancybox_handler );
    </script>

    If you can share a link to your page with this switcher panel, I can tell you more 🙂

    Thread Starter xs650

    (@xs650)

    My page is here
    http://northiowacorridor.com/business-climate/incentives/

    Two panels, Local & State from the Top Sub nav

    Easy Fancy Box works great on the first panel that loads with the page

    Thanks for helping me with this.

    OK, remove the two (!) on-click code snippets and instead create a text widget in your sidebar (place it last) with no title and the code

    <script type="text/javascript">
    jQuery('#switcher-panel').on('focusin', easy_fancybox_handler );
    </script>

    as content.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Live() Function’ is closed to new replies.