Results 1 to 5 of 5

Thread: Tabbed Document Viewer Inline Window Problem

  1. #1
    Join Date
    Jul 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down Tabbed Document Viewer Inline Window Problem

    1) Script Title: Tabbed Document Viewer

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...bdocviewer.htm

    3) Describe problem:

    I am unable to get the websites tabbed to appear in the window. They always just load on screen.

    Below is the code I'm using. I won't post the page, though, since the site is adult content.

    Code:
    <html>
    <head>
    
    <style type="text/css">
    
    /*Eric Meyer's based CSS tab*/
    
    #tablist{
    padding: 3px 0;
    margin-left: 0;
    margin-bottom: 0;
    margin-top: 0.1em;
    font: bold 14px Verdana;
    }
    
    #tablist li{
    list-style: none;
    display: inline;
    margin: 0;
    }
    
    #tablist li a{
    text-decoration: none;
    padding: 3px 0.5em;
    margin-left: 3px;
    border: 1px none #778;
    border-bottom: none;
    background: pink;
    }
    
    #tablist li a:link, #tablist li a:visited{
    color: blue;
    }
    
    #tablist li a:hover{
    color: black;
    background: pink;
    border-color: pink;
    }
    
    #tablist li a.current{
    background: white;
    }
    
    </style>
    
    <script type="text/javascript">
    
    /***********************************************
    * Tabbed Document Viewer script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Modified by Raymond Angana rangana in dynamicdrive.com/forums
    * First seen in dynamicdrive.com/forums
    * Modification - Allow multiple tabbed content viewer
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var selectedtablink=""
    var tcischecked=false
    
    function handlelink(aobject,targFrame){
    selectedtablink=aobject.href
    tcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false
    if (document.getElementById && !tcischecked){
    var tabobj=document.getElementById("tablist")
    var tabobjlinks=tabobj.getElementsByTagName("A")
    for (i=0; i<tabobjlinks.length; i++)
    tabobjlinks[i].className=""
    aobject.className="current"
    document.getElementById(targFrame).src=selectedtablink
    return false
    }
    else
    return true
    }
    
    function handleview(e){
    if (document.getElementById && e.checked){
    if (selectedtablink!="")
    window.location=selectedtablink
    }
    }
    
    </script>
    
    </head>
    <body>
    
    <ul id="tablist">
    <li><a class="current" href="welcome.html" onClick="return handlelink(this)">Welcome!</a></li>
    <li><a href="bio.html" onClick="return handlelink(this)">Bio</a></li>
    <li><a href="videos.html" onClick="return handlelink(this)">Videos</a></li>
    <li><a href="pictures.html" onClick="return handlelink(this)">Pictures</a></li>
    </ul>
    <iframe id="tabiframe" src="welcome.html" width="75%" height="750px"
    scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
    
    <form name="tabcontrol" style="margin-top:0">
    </form>
    
    </body>
    </html>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You've made some modifications to the markup and possibly to the script code as well. In any case, use this version of the script code:

    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Tabbed Document Viewer script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Modified by Raymond Angana rangana in dynamicdrive.com/forums
    * First seen in dynamicdrive.com/forums
    * Modification - Allow multiple tabbed content viewer
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var selectedtablink=""
    var tcischecked=false
    
    function handlelink(aobject,targFrame){
    targFrame = targFrame || 'tabiframe';
    selectedtablink=aobject.href
    tcischecked= false
    if (document.getElementById && !tcischecked){
    var tabobj=document.getElementById("tablist")
    var tabobjlinks=tabobj.getElementsByTagName("A")
    for (i=0; i<tabobjlinks.length; i++)
    tabobjlinks[i].className=""
    aobject.className="current"
    document.getElementById(targFrame).src=selectedtablink
    return false
    }
    else
    return true
    }
    
    function handleview(e){
    if (document.getElementById && e.checked){
    if (selectedtablink!="")
    window.location=selectedtablink
    }
    }
    
    </script>
    Notes: That fixes the viewer for the code in your post. However, if any of these pages you want to open in the viewer have code on them to "break out of frames", there's nothing you can do about it unless you can remove that code from that/those page(s).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    You've made some modifications to the markup and possibly to the script code as well. In any case, use this version of the script code:

    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Tabbed Document Viewer script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Modified by Raymond Angana rangana in dynamicdrive.com/forums
    * First seen in dynamicdrive.com/forums
    * Modification - Allow multiple tabbed content viewer
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var selectedtablink=""
    var tcischecked=false
    
    function handlelink(aobject,targFrame){
    targFrame = targFrame || 'tabiframe';
    selectedtablink=aobject.href
    tcischecked= false
    if (document.getElementById && !tcischecked){
    var tabobj=document.getElementById("tablist")
    var tabobjlinks=tabobj.getElementsByTagName("A")
    for (i=0; i<tabobjlinks.length; i++)
    tabobjlinks[i].className=""
    aobject.className="current"
    document.getElementById(targFrame).src=selectedtablink
    return false
    }
    else
    return true
    }
    
    function handleview(e){
    if (document.getElementById && e.checked){
    if (selectedtablink!="")
    window.location=selectedtablink
    }
    }
    
    </script>
    Notes: That fixes the viewer for the code in your post. However, if any of these pages you want to open in the viewer have code on them to "break out of frames", there's nothing you can do about it unless you can remove that code from that/those page(s).
    Thank you! The pages just go to text, a video bar, and a pic slideshow, so I don't think those can break out of frames.

    I took out everything on the pages and I used the code you gave me, but the pages still won't load inline.

    I'm thinking it may be a browser problem.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Instead of taking out everything, just replace the script part with the code in my post.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Instead of taking out everything, just replace the script part with the code in my post.
    Thanks!

    It's working now

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •