TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 292
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 171
  • Total: 171

Open article menu links in center window

Started by me123, May 31, 2008, 10:29:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

me123

I want to open external websites in TP. I have made an article in HTML. This article opens via a click in the menu.
I deselected the left/center/right blocks, so all the room is available for the loading of an external page.

I have a javascript dropdownmenu. Here I can choose the links.




<style type="text/css">
@charset "charset=iso-8859-1";


/* CSS Document */

#sddm
{ margin: 0;
padding: 0;
z-index: 30}

#sddm li
{ margin: 0;
padding: 0;
list-style: none;
float: left;
font: bold 11px arial}

#sddm li a
{ display: block;
margin: 0 1px 0 0;
padding: 4px 10px;
width: 60px;
background: #5970B2;
color: #FFF;
text-align: center;
text-decoration: none}

#sddm li a:hover
{ background: #49A3FF}

#sddm div
{ position: absolute;
visibility: hidden;
margin: 0;
padding: 0;
background: #EAEBD8;
border: 1px solid #5970B2}

#sddm div a
{ position: relative;
display: block;
margin: 0;
padding: 5px 10px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
background: #EAEBD8;
color: #2875DE;
font: 11px arial}

#sddm div a:hover
{ background: #49A3FF;
color: #FFF}

</style>
<script>
// Copyright 2006-2007 javascript-array.com

var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;

// open hidden layer
function mopen(id)
{
// cancel close timer
mcancelclosetime();

// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}

// close layer when click-out
document.onclick = mclose;


</script>


</head>

<body>


<ul id="sddm">
    <li><a href="#"
        onmouseover="mopen('m1')"
        onmouseout="mclosetime()">News</a>
      <div id="m1"
            onmouseover="mcancelclosetime()"
            onmouseout="mclosetime()">
        <a href="http://www.link1.html">link1</a>
        <a href="http//www.link2.html">link2</a>
       
       
       
      </div>
       
       
    </li>



This shows a menu and when you 'mouse over' it drops down 'link1 link2, ... '
When I use target="_blank" or "_self" it still opens in a new window. I want it to open in TP... I did a lot of research and it has something to do with IFRAMES, but I don't know how that works...

JPDeni

You can do one of two things ---

First, use iframes. Create an html article and in the source code put

<iframe src="http://url.to.yourpage/page.html"></iframe>

(other attributes can be found here or other places)

Second, you can copy your html from the other pages into an html article.

Either way you will need to alter your links to point to the TP article that you use for the page.

In order to display something in TinyPortal, it must be in either a block or an article, or hard-coded into the script.

This website is proudly hosted on Crocweb Cloud Website Hosting.