WordPress.org

Support

Support » Plugins and Hacks » Post UI Tabs » [Resolved] Tab 2 seems to replace Tab 1, remove code in Tab 2 and Tab 1 functions normal

[Resolved] Tab 2 seems to replace Tab 1, remove code in Tab 2 and Tab 1 functions normal

  • I have the jwplayer javascript code in two different tabs because they use provide different content.

    When I place the code in both tabs, they are created but it appears the the code in tab 2 is overwriting the code in tab 1.

    If I remove the code in tab 2, tab 1 functions normally.

    I’m not sure what is going wrong but it seems that it cannot isolate the code in tab 2 so you can switch between the tabs.

    The idea is Tab 1 displays one player with a list of content and the Tab 2 shows a player with different content.

    There is something I’m missing because when I remove the code from tab two and put text, ie: Coming Soon… I can switch between tabs normally.

    I’m not sure if I have to isolate the code in tab 2 somehow to fix the issue. Looking for some assistance because it seems like a simple fix but nothing has worked yet.

    Thanks

    http://wordpress.org/extend/plugins/put/

Viewing 15 replies - 1 through 15 (of 20 total)
  • Just to add,

    The code is identical for both jwplayers, but point to different locations.

    So technically it should just treat it separate content in both tabs.

    This is the test site url, http://demo.djquartz.org/qronline/

    Plugin Author Mark / t31os

    @t31os_

    And if you insert both these players in the editor, but outside the tab shortcodes, do they then function as expected?

    Correct,

    I can display both of them on one page without problem. I did test that as a troubleshooting process.

    I can put the code back in so you can see what happens.

    I’ve added the player code for the Archive tab. You can see what I mean now.

    Plugin Author Mark / t31os

    @t31os_

    So what exactly are you putting inside the tab shortcodes, another shortcode or are you adding in HTML?

    Are you using another WordPress plugin to insert this other content?

    I’ll try to replicate the problem this end once i know more.

    Would you like to see the code example?

    It’s basically this,

    [tab]
    javascript code
    [/tab]

    [tab]
    javascript code
    [/tab]

    [end_tabset]

    If I do this….

    [tab]
    player code
    [/tab]

    [tab]
    Coming soon…
    [/tab]

    [end_tabset]

    The first tab displays correctly.

    Plugin Author Mark / t31os

    @t31os_

    I’ll need to specifically see what code you’re putting between the tab shortcodes, could you provide a sample of the applicable javascript/player code you’re placing into the editor?

    [tab name="Current"]
    <div id="player1">
    <p id="preview" align="center">The player will show in this paragraph</p>
    
    <div align="center"><script type="text/javascript" src="../radio/swfobject.js"></script><script type="text/javascript">// <![CDATA[
    var s1 = new SWFObject("../radio/player.swf","ply","845","480","9","#FFFFFF"); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars',"file=../radio/playlist.xml&playlist=right&playlistsize=400&volume-100&stretching=none&fullscreen=true&caption=true&logo=../radio/jwskins/front6c.jpg&skin=../radio/jwskins/flashskins20ice.swf"); s1.write('preview');
    // ]]></script></div>
    </div>
    [/tab]
    
    [tab name="Archive"]
    <div id="player2">
      <p align="center"> </p>
      <p align="center"> </p>
     <p align="center" id='preview'>The player will show in this paragraph</p>
     <div align="center">
       <script type='text/javascript' src='../radio/archive/swfobject.js'></script>
       <script type='text/javascript'>
    var s1 = new SWFObject("../radio/archive/player.swf","ply","845","480","9","#FFFFFF");
    s1.addParam('allowfullscreen','true');
    s1.addParam('allowscriptaccess','always');
    s1.addParam('flashvars',"file=../radio/archive/playlist.xml&playlist=right&playlistsize=400&volume-100&stretching=none&fullscreen=true&caption=true&logo=../radio/archive/jwskins/vinyl.jpg&skin=../radio/archive/jwskins/flashskins20amber.swf");
    s1.write('preview');
     </script>
      </p>
     </div>
    </div>
    [/tab]
    
    [end_tabset]

    [Please post code or markup between backticks or use the code button. Or better still – use a pastebin. Your posted code may now have been permanently damaged/corrupted by the forum’s parser.]

    ignore this,

    <p align="center"> </p>
    <p align="center"> </p>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    There were spaces, I deleted this since.

    It almost seems like I need to isolate the code in the second tab section somehow.

    Plugin Author Mark / t31os

    @t31os_

    Ok i tested your code, updating the javascript URIs to point at your site(so i could test it) and ended up with the following in my post editor.

    With tab shortcodes
    http://pastebin.mozilla.org/2390114

    I then tested without the shortcodes.
    http://pastebin.mozilla.org/2390137

    And it displayed exactly the same, the second player did not show up. I did specifically ask before if the code functioned outside the tabs shortcode and you said it did, but that’s unfortunately not what i’m seeing here, the second player does not load up even when used absent the tab shortcodes.

    Note: Pastebins are set to live for 1 day, they’ll expire by this time tomorrow(incase you have any concerns about pastebins with links to your site).

    This is what confuses me.

    How is the code that is in the second tab section taking precedence over the code that is in the first tab?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Resolved] Tab 2 seems to replace Tab 1, remove code in Tab 2 and Tab 1 functions normal’ is closed to new replies.
Skip to toolbar