Support » Plugin: WP YouTube Lyte » Hidden elements

  • You should consider object visibility I think.
    Let’s assume you use shortcode to present video on some page but container which holds Lyte element is hidden. Once you make it visible onclick action won’t work. I think you should check whether object is really visible or not. Proposed change in lyte.(min).js:

    for (var i = 0, lln = lts.length; i < lln; i += 1) {
    	    p = lts[i];
    	    if(p.offsetParent !== null) { //CHECKS WHETHER OBJECT IS VISIBLE OR NOT
    		    vid = p.id.substring(4);
    		    if (mOs === null) {

    Once block shows (i.e. popup) developer will be able to execute ly.te() once again and display correct video instance. What do you think?

    https://wordpress.org/plugins/wp-youtube-lyte/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Once you make it visible onclick action won’t work.

    just tested this; what I see is the lyte onclick works (so the youtube iframe will start to load), but subsequent clicks on video in the youtube player did not work. is that what you mean?

    frank

    Thread Starter Tomasz Dobrzyński

    (@tomaszdobrzynski)

    Frank, that’s right, exactly.
    Btw: I think “Visual Event” plugin would be helpful in diagnosis of this case.

    Plugin Author Frank Goossens

    (@futtta)

    OK, I see. And with your fix this problem doesn’t occur, but that will require the developer who unhides a lyte-div to call ly.te() him- / herself? Do you have this running somewhere?

    frank

    Thread Starter Tomasz Dobrzyński

    (@tomaszdobrzynski)

    Yes, to generate working player with active onclick event you need to execute ly.te() once again when popup is opened (when its content is already visible).
    It’s internal project but today I’ll try to clone problematic section somehow.

    Plugin Author Frank Goossens

    (@futtta)

    not ly.te to visible elements would indeed require extra work for the developer. what if we were to apply an eventhandler to the hidden divs which automatically applies ly.te() when they become visible. not sure if this is possible, but would be nicer, no?

    frank

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