have tables in hover popups

This is a discussion on "have tables in hover popups" within the JavaScript Forum section. This forum, and the thread "have tables in hover popups are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 29th, 2006, 04:25
New Member
Join Date: Nov 2006
Location: OZ
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
have tables in hover popups

I am using code to make a popup on mouseover,eg.

<style type="text/css">
#popup {
/* Necessary: */
position: absolute;
display: none;
z-index: 10;

/* Additional styling: */
width: 250px;
padding: 5px;
etc etc
}
</style>

Anyway, I'm wondering whether I can put something in so that the popup will be able to display tables somehow. So instead of having plain text on a background, it can display text in 3 different rows. The effect I'm after is like on some sites where the links are double-underlined, you hover and a very nice looking box appears with rounded corners. (The rounded corners would be nice, but I'm more wondering how to have different parts of the popup box look different.

If this makes sense and somebody knows, please help...

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 22nd, 2006, 07:25
New Member
Join Date: Dec 2006
Location: US
Age: 19
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: have tables in hover popups

I know what you are talking about. The code that I have used (but not originally mine) is:

<html>
<head>

<STYLE TYPE="text/css">
<!--
#dek {position:absolute;margin-top:300;visibility:hidden;Z-INDEX:200;}
//-->
</STYLE>
</head>
<body>
<center>
<DIV ID="dek"></DIV>
</center>
<SCRIPT TYPE="text/javascript">
<!--

Xoffset= 0; // modify these values to ...
Yoffset= 0; // change the popup position.
var old,skn,iex=(document.all),yyy=-1000;
var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all
if (ns4)
skn=document.dek
else if (ns6)
skn=document.getElementById("dek").style
else if (ie4)
skn=document.all.dek.style
if(ns4);
else{
skn.visibility="visible"
skn.display="none"
}
function popup(bak){
var msg="This is not orignally my script but I have edited it a lot.";
var content="<TABLE WIDTH=300 BORDER=1 BORDERCOLOR=#800000 CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR='#990000'><td><FONT COLOR=white SIZE=3><center>Text here</center></font></td></table><TABLE style='border-top-width:0' WIDTH=300 BORDER=1 BORDERCOLOR=#800000 CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=white SIZE=3>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
if(ns4){skn.document.write(content);skn.document.c lose();skn.visibility="visible"}
if(ns6){document.getElementById("dek").innerHTML=c ontent;skn.display=''}
if(ie4){document.all("dek").innerHTML=content;skn. display=''}
}

function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}
//-->
</SCRIPT>


<a href="" onmouseover="javascript: popup('#000000')" ONMOUSEOUT="kill()">Hover to See</a>



This will create two tables when you hover over it. You will have to mess around with the styles and position

Last edited by john787787; Dec 22nd, 2006 at 07:28. Reason: forgot something
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 22nd, 2006, 15:20
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: have tables in hover popups

You shouldn't be looking to create table unless they are to hold tabular data. you should be using <div> elements.

And use css to make the popup both appear and disappear. You shouldn't need JavaScript for this.

Consider what is to happen if someone is using assistive technology and css and/or JavaScript are not available to them.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 23rd, 2006, 13:36
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: have tables in hover popups

I hate seeing code as bad as John78...'s. It makes me sad.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 23rd, 2006, 15:27
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Re: have tables in hover popups

aww...

What I think you're looking for is something explained here, that only uses CSS (& a Javascript function for silly IE6):
http://www.alistapart.com/articles/dropdowns/

This is the kind of thing it can produce, you can see if it's what you're after:
http://www.htmldog.com/articles/suckerfish/example/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
popup

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Hover Effect In IE Monie Web Page Design 6 Feb 12th, 2008 00:43
CSS li hover. PicoDeath Web Page Design 9 Dec 19th, 2007 14:26
css hover alexgeek Web Page Design 9 Aug 2nd, 2007 18:18
hii Help with hover hawashp Starting Out 1 May 13th, 2007 16:35


All times are GMT. The time now is 00:37.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved