SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Swap text onRollover text?
-
Dec 9, 2003, 07:30 #1
- Join Date
- Jan 2001
- Location
- Near a computer
- Posts
- 782
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Swap text onRollover text?
Hi there,
I think i need to post this here, i need the following for my site:
1 Each product is represented bij a square.gif (with a roll-over "squareon.gif)
2 Onrollover/onmouseover a corresponding text is shown, each time on the same place on the stage. For these i am using a layer/div and display: none;
So far i have things working dynamicly with PHP, that is each product is shown as a square and the corresponding texten sits there.
Now what i want to do is, to show the corresponding text when a user (onmouseover) square.gif. How do i do this?
code parsed by php
PHP Code:<td class="leftAlign"><div id="div1" style="position:absolute; left:10px; top:10px; width:170px; height:20px; z-index:1; visibility: hidden;">Flyer 1</div>
<a href="#" onMouseOver="SwapImg ('dtl1','over') , SwapTxt ('div1','over')"
onMouseOut="SwapImg ('dtl1','out'), SwapTxt ('div1','out')">
<img src="images/sq_false.gif" width="7" height="7" border="0" name="dtl1" />
</a>
<div id="div2" style="position:absolute; left:10px; top:10px; width:170px; height:20px; z-index:2; visibility: hidden;">Flyer 2</div>
<a href="#" onMouseOver="SwapImg ('dtl2','over') , SwapTxt ('div2','over')"
onMouseOut="SwapImg ('dtl2','out'), SwapTxt ('div2','out')">
<img src="images/sq_false.gif" width="7" height="7" border="0" name="dtl2" />
</a>
<div id="div3" style="position:absolute; left:10px; top:10px; width:170px; height:20px; z-index:3; visibility: hidden;">Poster</div>
<a href="#" onMouseOver="SwapImg ('dtl3','over') , SwapTxt ('div3','over')"
onMouseOut="SwapImg ('dtl3','out'), SwapTxt ('div3','out')">
<img src="images/sq_false.gif" width="7" height="7" border="0" name="dtl3" />
</a>
</td>
Does these make sense:
PHP Code:function SwapTxt(divID, action) {
switch (action)
{
case "over":
document.getElementById("divID").style.display = "block";
break;
case "out":
document.getElementById("divID").style.display = "none";
break;
}
}
ps not mine just combining some things i have found on the subject
Any tips?
-
Dec 9, 2003, 09:47 #2
Moved to the appropriate forum.
Former Design Your Site Team Leader
-
Dec 9, 2003, 11:13 #3
- Join Date
- Dec 2002
- Location
- Alabama, USA
- Posts
- 2,560
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
function SwapTxt(divID, action) {
switch (action)
{
case "over":
document.getElementById("divID").style.display = "block";
break;
case "out":
document.getElementById("divID").style.display = "none";
break;
}
}Cross-Browser.com, Home of the X Library
Bookmarks