Results 1 to 10 of 10

Thread: Tabbed Document Viewer - tabs open in new window

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tabbed Document Viewer - tabs open in new window

    1) Script Title: Tabbed Document Viewer

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

    3) Describe problem:
    I'm using TiddlyWiki which allows me to paste html code into a Note (Tiddly) and usually it works.

    The script works - I get the tabbed page an it opens automatically with Google. However, if I click on a tab, it opens a new browser page NOT the inline page that I want. The checkbox for opening in a new windows is NOT checked. It is a very useful script, can anyone suggest a solution to make the clicked tab open in its Iframe, as it first does?

    The script does behave properly in a normal blank html page (not TiddlyWiki) so maybe TiddlyWiki does not like something?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.

  3. #3
    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

    If the page you are loading has code to break out of frames, unless you can remove that code, it will break out of the iframe, period.
    - John
    ________________________

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

  4. #4
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I uploaded the test to http://www.the-bizness.co.uk/wikis/t...mptwtheme.html

    Hit the search engines link on the right and you get the very nice google iframe. The great thing about tiddlywiki is you can look at all the code - it's all packed into the one html file.

  5. #5
    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

    This is how the style, script, and its markup appears in your generated source:

    Code:
    <html>\n<head>\n<title>Tabbed Doc Memory - Demo</title>\n<style type="text/css">\n\n/*Eric Meyer's based CSS tab*/\n\n#tablist{\npadding: 3px 0;\nmargin-left: 0;\nmargin-bottom: 0;\nmargin-top: 0.1em;\nfont: bold 12px Verdana;\n}\n\n#tablist li{\nlist-style: none;\ndisplay: inline;\nmargin: 0;\n}\n\n#tablist li a{\ntext-decoration: none;\npadding: 3px 0.5em;\nmargin-left: 3px;\nborder: 1px solid #778;\nborder-bottom: none;\nbackground: white;\n}\n\n#tablist li a:link, #tablist li a:visited{\ncolor: navy;\n}\n\n#tablist li a:hover{\ncolor: #000000;\nbackground: #C1C1FF;\nborder-color: #227;\n}\n\n#tablist li a.current{\nbackground: lightyellow;\n}\n\n.tabcurrent{\ndisplay:block;\n}\n\n.tabbkgrnd{\ndisplay:none;\n}\n\n</style>\n\n<script type="text/javascript">\n\n/***********************************************\n* Tabbed Document Viewer script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)\n* This notice MUST stay intact for legal use\n* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code\n***********************************************/\n\nvar selectedtablink=""\nvar tcischecked=false\n\nfunction handlelink(aobject, frameNum){\nselectedtablink=aobject.href\ntcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false\nif (document.getElementById && !tcischecked){\nvar tabobj=document.getElementById("tablist")\nvar tabobjlinks=tabobj.getElementsByTagName("A")\nfor (i=0; i<tabobjlinks.length; i++)\ntabobjlinks[i].className=""\naobject.className="current"\ndispFrames=document.getElementsByTagName('iframe');\nfor (i = 0; i < dispFrames.length; i++)\nif(dispFrames[i].className=='tabcurrent')\ndispFrames[i].className='tabbkgrnd'\ndocument.getElementById("tabiframe"+frameNum).className='tabcurrent'\nif (document.getElementById("tabiframe"+frameNum).src==''||document.getElementById("tabiframe"+frameNum).src==location.href)\ndocument.getElementById("tabiframe"+frameNum).src=selectedtablink\nreturn false\n}\nelse\nreturn true\n}\n\nfunction handleview(){\ntcischecked=document.tabcontrol.tabcheck.checked\nif (document.getElementById && tcischecked){\nif (selectedtablink!="")\nwindow.location=selectedtablink\n}\n}\n\n\n</script>\n</head>\n<body>\n<ul id="tablist">\n<li><a class="current" href="http://www.google.com" onClick="return handlelink(this, 0)">Google</a></li>\n<li><a href="http://www.yahoo.com" onClick="return handlelink(this, 1)">Yahoo</a></li>\n<li><a href="http://www.msn.com" onClick="return handlelink(this, 2)">MSN</a></li>\n<li><a href="http://www.news.com" onClick="return handlelink(this, 3)">News.com</a></li>\n<li><a href="http://www.dynamicdrive.com" onClick="return handlelink(this, 4)">Dynamic Drive</a></li>\n</ul>\n<iframe class="tabcurrent" id="tabiframe0" src="http://www.google.com" width="98%" height="350px"></iframe>\n<iframe class="tabbkgrnd" id="tabiframe1" src="" width="98%" height="350px"></iframe>\n<iframe class="tabbkgrnd" id="tabiframe2" src="" width="98%" height="350px"></iframe>\n<iframe class="tabbkgrnd" id="tabiframe3" src="" width="98%" height="350px"></iframe>\n<iframe class="tabbkgrnd" id="tabiframe4" src="" width="98%" height="350px"></iframe>\n\n<form name="tabcontrol" style="margin-top:0">\n<input name="tabcheck" type="checkbox" onClick="handleview()"> Open tab links in browser window instead.\n</form>\n</body>\n</html>
    It has to look like it does on the demo page, not like the above. I have no idea how to get the TiddlyWiki package to do that, refer to its documentation or post in a TiddlyWiki help forum.
    - John
    ________________________

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

  6. #6
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Tabs not showing

    Hi Folks,

    I have downloaded your tabbed document veiwer.

    I have got it to position correctly however the tabs do not appear as the demo does.

    A link to this site is http://www.gnjgf.co.za/constitution.php

    PLease could someone advise me as to what I should do to correct this problem.

    Regards

    rob

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

    Quote Originally Posted by Rob (SA) View Post
    Hi Folks,

    I have downloaded your tabbed document veiwer.

    I have got it to position correctly however the tabs do not appear as the demo does.

    A link to this site is http://www.gnjgf.co.za/constitution.php

    PLease could someone advise me as to what I should do to correct this problem.

    Regards

    rob
    As far as the tabs not looking as expected, style belongs in the head of a document (they actually look OK in FF, FF is being lenient). I believe that you also have an onload or other script conflict, at least in some browsers (Opera, IE). This would affect the functionality of the script in those browsers, and may be the main problem.
    - John
    ________________________

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

  8. #8
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    As usual you are prompt to reply.

    You make reference to an onload or other script conflict.

    How do I fix this problem if it is an onload conflict - What is an onload conflict. I am not a website designer and thus terminology needs to be learnt.

    Script conflict I accept is as it is in plain english. The problem is identifying which is in conflict. Any suggestions?

    Regards
    Rob

  9. #9
    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

    Upon closer examination of your page, although it is very messy, invalid and exhibits signs of failure in following the script installation instructions, the only real problem with this script and its style appears to be that you have left in the beginning of a form tag for a form that looks like it's no longer used (from your source code):

    Code:
     . . . ment.getElementById && tcischecked){
    if (selectedtablink!="")
    window.location=selectedtablink
    }
    }
    
    </script><form name="Form1" method="POST" action="" enctype="application/x-www-form-urlencoded" id="Form1" <ul id="tablist">
    <li><a class="current" href="http://www.google.com" onClick="return handlelink(this)">CONSTITUTION</a></li>
    <li><a href="http://www.yahoo.com" onClick="return handlelink(this)">HOUSE HOLD RULES</a></li>
    <li><a href="http://www.msn.com" onClick="return handlelink(this)">MSN</a></li>
    <li><a href="http://www.news.com" onClick="return handleli . . .
    Get rid of the red part:

    Code:
    <form name="Form1" method="POST" action="" enctype="application/x-www-form-urlencoded" id="Form1" 
    Doing just that much will get the tabbed viewer looking OK and working.
    - John
    ________________________

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

  10. #10
    Join Date
    May 2007
    Location
    South Africa
    Posts
    175
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    HI John,

    As usual - perfect fix

    Thanks so much

    Regards
    Rob

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
  •