jQuery UI Widgets Forums Navigation Menu, Context Menu Menue disappears when loading into iframe

Tagged: ,

This topic contains 8 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 4 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • Menue disappears when loading into iframe #8379

    carlo
    Participant

    Hi Peter,

    we have a strange problem concerning loading pages into an iframe with jqWidgets. The menue is loading the pages iframe1.html and iframe2.html into an iframe. Most of the time everything is working fine. The pages are loaded into the iframe. But after selecting both menue points cyclic for a time, the main page dissapears and only the iframe page is loaded. Heres is a demo page: http://85.214.211.237/jqw/main.html demonstrating the behaviour.

    This is very urgent, because our customers complain about vanishing menues.

    Best Regards
    Karlheinz

    Menue disappears when loading into iframe #8380

    Peter Stoev
    Keymaster

    Hi Karlheinz,

    Actually, the Menu does not disappear. When the menu item is clicked, the browser navigates to the IFrame’s page. The solution is to use the ‘itemclick’ event for switching the IFrame’s src.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Menue disappears when loading into iframe #8382

    carlo
    Participant

    Hi Peter,

    why does the browser navigate most of the times to the main page and sometimes to the iframe ? Why can we not use the target in the menue items and why is ‘itemclick’ better ?

    Best Regards
    Karlheinz Rafalski

    Menue disappears when loading into iframe #8383

    Peter Stoev
    Keymaster

    Hi Karlheinz,

    ‘itemclick’ should be used if you want to load content within the same page. If you want to navigate to different pages, use anchor tags.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Menue disappears when loading into iframe #8384

    carlo
    Participant

    Hi Peter,

    how do you explain, that it does only happen when we use jqxMenu. Habe a look now at the demo page, where I removed the jqxMenu line. No more navigation to the iframes’s page: http://85.214.211.237/jqw/main.html .

    Best Regards,
    Karlheinz Rafalski

    Menue disappears when loading into iframe #8387

    Peter Stoev
    Keymaster

    Hi Karlheinz,

    Please, use the provided solution in my previous post in case you want to use jqxMenu. The ‘itemclick’ event should be used if you want to load content within the same page. If you want to navigate to different pages, use anchor tags instead.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Menue disappears when loading into iframe #8388

    carlo
    Participant

    Hi Peter,

    okay, I am trying to use the ‘itemclick’ event. So I give every menue element an ID like … . In the ‘itemclick’ event I do

    if(event.args.id==’m1′)
    {
    // load page belonging to m1 into iframe
    }
    else if(event.args.id==’m2′)
    {
    // load page belonging to m2 into iframe
    }
    etc.

    Is there a more elegant way to do this ?

    Best Regards
    Karlheinz Rafalski

    Menue disappears when loading into iframe #8432

    carlo
    Participant

    Hi Peter,

    I would like to inform you, how we solved it in the end. We removed all href’s and target’s from the menue items and added a ‘data-url’ attribute:

    <li><a data-url="/page1.aspx">Page 1</a></li>

    In the itemclick event we read the data-url attribute and set the iframe’s source:

    $("#menue").bind('itemclick', function (event) {
    var url = $(event.target).attr("data-url");
    $("#iframe").attr('src', url);
    });

    Best Regards,
    Karlheinz Rafalski

    Menue disappears when loading into iframe #8436

    Peter Stoev
    Keymaster

    Hi Karlheinz,

    Thanks for the update!

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.