WordPress.org

Forums

Post UI Tabs
[resolved] Tab 2 seems to replace Tab 1, remove code in Tab 2 and Tab 1 functions normal (21 posts)

  1. djquartz
    Member
    Posted 3 years ago #

    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/

  2. djquartz
    Member
    Posted 3 years ago #

    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.

  3. djquartz
    Member
    Posted 3 years ago #

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

  4. Mark / t31os

    Plugin Author

    Posted 3 years ago #

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

  5. djquartz
    Member
    Posted 3 years ago #

    Correct,

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

  6. djquartz
    Member
    Posted 3 years ago #

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

  7. djquartz
    Member
    Posted 3 years ago #

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

  8. Mark / t31os

    Plugin Author

    Posted 3 years ago #

    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.

  9. djquartz
    Member
    Posted 3 years ago #

    Would you like to see the code example?

    It's basically this,

    [tab]
    javascript code
    [/tab]

    [tab]
    javascript code
    [/tab]

    [end_tabset]

  10. djquartz
    Member
    Posted 3 years ago #

    If I do this....

    [tab]
    player code
    [/tab]

    [tab]
    Coming soon...
    [/tab]

    [end_tabset]

    The first tab displays correctly.

  11. Mark / t31os

    Plugin Author

    Posted 3 years ago #

    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?

  12. djquartz
    Member
    Posted 3 years ago #

    [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.]

  13. djquartz
    Member
    Posted 3 years ago #

    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.

  14. djquartz
    Member
    Posted 3 years ago #

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

  15. Mark / t31os

    Plugin Author

    Posted 3 years ago #

    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).

  16. djquartz
    Member
    Posted 3 years ago #

    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?

  17. djquartz
    Member
    Posted 3 years ago #

    The second player is displayed actually, but it takes place of the first player which seems weird.

    Let me check something.

  18. Mark / t31os

    Plugin Author

    Posted 3 years ago #

    It's not, it's simply not working... for whatever reason.

    I'm not familiar with jwplayer, so i can't speak as to why that is.

    NOTE:
    You have alot of 404 requests stacking up related to that jwplayer Javscript, if you have firebug, load the page up with the console on the NET tab and watch the number of 404 requests you're getting(it could be related, maybe not).

  19. djquartz
    Member
    Posted 3 years ago #

    I fixed it,

    http://www.longtailvideo.com/support/forums/jw-player/feature-suggestions/10180/multiple-players-on-same-page/

    I had to change the id to a different name and use it to call the second player.

    It has a global effect otherwise.

    Thanks, talking it through helped me realize where the problem was.

  20. djquartz
    Member
    Posted 3 years ago #

    Just testing the fix and it's working as it should now.

  21. Mark / t31os

    Plugin Author

    Posted 3 years ago #

    Happy to hear you resolved the problem and appreciate you posting your solution to, there may be other people that stumble upon the thread and they'll be happy to find that information.

    Good luck with your WordPress site. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post UI Tabs
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.