0

In my attempt to find a simple solution to youtube-popup, I found http://nrivers.com/codecanyon/n1/ - videopopup.js script. The framework is lightweight and works well - however there a function that is set to work with jquery-1.7.

the little "x" to close - does not work if using jquery 2.1 but works if using 1.7 or less. the jsfiddle is at http://jsfiddle.net/jw93b/

I have imported the code into the JS window - but can't understand what code to change. Can someone help with updating the code in JS window so it can work with jquery 2.1 (which is required by another plugin).

I think the code that requires update is

    $(".modalnav").live("click", function () {
        $("#dvGlobalMask").hide();
        $("#videopopup").hide();
        $(".modalnav").hide();
        $('#videocontent').html('');
        $(settings.videoid).hide()
    })
hypermails
  • 726
  • 1
  • 10
  • 28
  • The `.live()` function has been deprecated for a *really* long time. Look at the documentation for `.on()`. – Pointy Jul 16 '14 at 05:06
  • ok - after some pointers - I guess this thread is the possible solution for this question. http://stackoverflow.com/questions/8021436/turning-live-into-on-in-jquery - still if some one can port that .live function statement, it would help - thanks – hypermails Jul 16 '14 at 05:52
  • $("body").on("click",".modalnav",function () {... thanks for pointers – hypermails Jul 16 '14 at 05:58

1 Answers1

1

from another thread - I tested the following and it works.

thanks to pointy and this thread Turning live() into on() in jQuery. replaced the live function with on function.

    $("body").on("click",".modalnav",function () {

thanks

Community
  • 1
  • 1
hypermails
  • 726
  • 1
  • 10
  • 28