PDA

View Full Version : How to initialize page again



rmmarsh
12-14-2006, 10:31 PM
1) Script Title: image mouseover effects

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/linkinfo.htm
3) Describe problem: I want the text to revert back to the same as when the page was loaded when the mouse is not hovering over a link (image in my case)... can't figure out how to re-initialize the text area.

Great stuff, guys!

jscheuer1
12-15-2006, 06:03 AM
Here's one way:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
<!--

/*
Textual Tooltip Script-
Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/


var content=new Array()
//change the array below to the text associated with your links Expand or contract the array, depending on how many links you have
content[0]='<br><big><b>Menus and navigation systems</b></big><br>Click here for DHTML scripts that help enhance your site\'s navigability, such as collapsible menus, sliding menu bars etc.'
content[1]='<br><big><b>Special document effects</b></big><br>With the advent of DHTML, webpages are one step closer to its cousin, TV, in terms of special effects...'
content[2]='<br><big><b>Scrollers</b></big><br>Up until now, adding a scroller or tickertape to your website usually meant using a slow Java applet. Not anymore. Click here for DHTML scrollers that accomplish the same task with minimal download time.'
content[3]='<br><big><b>Image effects</b></big><br>Add lightweight effects to your existing images using these scripts. Make them fly, light up, turn static, all without paying the cost of slow downloading time.'
content[4]='<br><big><b>Links and buttons</b></big><br>Add tooltips to your text links, rollover effects to your form buttons, keyboard features to your document, and more.'
content[5]='<br><big><b>Dynamic clocks and dates</b></big><br>Time is never static, so why should your time script be? Enter for DHTML scripts that actually understand this simple truth.'
content[6]='<br><big><b>Text animations</b></big><br>Text have been silent for too long- DHTML promises to free them, with flying text, typing text, dragable text, and more.'
content[7]='<br><big><b>Browser window</b></big><br>Click here scripts related to the browser window and frames.'
content[8]='<br><big><b>Other</b></big><br>All scripts that don\'t comfortably fit in any of the above categories go here...'
content[9]='<big><strong><font face="Verdana" color="#000000"><p>Welcome to our new look!<br></font></strong></big><font face="Verdana">Hope you like the new look for Dynamic Drive. This is the first in a series of steps we\'re taking to improve our site. In the very near future, you can expect many cool features such as a new forum, newsletter, feedback form, and more, to be introduced. Enjoy!<br> </font>'
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}

}

function appear(){
document.d1.visibility='show'
}

window.onload=regenerate2


//-->
</script>
</head>
<body>
<div onmouseover="changetext(content[9])">&nbsp;
</div>
<table>
<tr>
<td width="250"><div id="scriptmenu" style="line-height:20px"><p><strong><font
face="Verdana"><a href="../dynamicindex1/index.html" onMouseover="changetext(content[0])"><small>Menus
and Navigation Systems</small></a><br>
<a href="../dynamicindex3/index.html" onMouseover="changetext(content[1])"><small>Special&nbsp;document
effects</small></a><br>
<a href="../dynamicindex2/index.html" onMouseover="changetext(content[2])"><small>Scrollers</small></a><br>
<a href="../dynamicindex4/index.html" onMouseover="changetext(content[3])"><small>Image
effects</small></a><br>
<a href="index.html" onMouseover="changetext(content[4])"><small>Links and buttons</small></a><br>
<a href="../dynamicindex6/index.html" onMouseover="changetext(content[5])"><small>Dynamic
Clocks and dates</small></a><br>
<a href="../dynamicindex10/index.html" onMouseover="changetext(content[6])"><small>Text
animations</small></a><br>
<a href="../dynamicindex8/index.html" onMouseover="changetext(content[7])"><small>Browser
Window</small></a><br>
<a href="../dynamicindex11/index.html" onMouseover="changetext(content[8])"><small>Other</small></a></font></strong></p>
</div></td><td><ilayer id="d1" width="200" height="200" visibility="hide">
<layer id="d2" width="200" height="200">
<div id="descriptions" align="left">

<!--Change below to default content of your own-->
<strong><font face="Verdana" color="#000000"><p>Welcome to our new look!<br>
</font></strong><font face="Verdana"><small>Hope you like the new look for Dynamic Drive.
This is the first in a series of steps we're taking to improve our site. In the very near
future, you can expect many cool features such as a new forum, newsletter, feedback form,
and more, to be introduced. Enjoy!</small><br>
</font>
<!--Stop editting-->

</div>
</layer>
</ilayer></td>
</tr>
</table>
<div onmouseover="changetext(content[9])">&nbsp;
</div>
</body>
</html>

rmmarsh
12-15-2006, 07:56 PM
Hmmm.... doesn't make any sense (you commented out the content[]... I tried to place it where I thought it might work, but it doesn't... here is my code... (as you can see, I'm still working my way through it, little by little)
---------------------------------------------------------------------------
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Sandbox.aspx.cs" Inherits="_Default" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<br />
<br />

<script>
var content=new Array()
content[0]='<br><big><b>Advanced, yet easy to use software</b></big><br> for managing your inventoryof books and customers; it also comes with a repricing tool (Patent Pending) to reprice your inventory. (the repricing tool is currently a part of the license, but that is subject to change).<p> Try it FREE for 30 days, if you like it, then you can purchase a License for only $29; otherwise you can use the basic features for no License fee. '
content[1]='<br><big><b>Special document effects</b></big><br>With the advent of DHTML, webpages are one step closer to its cousin, TV, in terms of special effects...'
content[2]='<br><big><b>Scrollers</b></big><br>Up until now, adding a scroller or tickertape to your website usually meant using a slow Java applet. Not anymore. Click here for DHTML scrollers that accomplish the same task with minimal download time.'
content[3]='<br><big><b>Image effects</b></big><br>Add lightweight effects to your existing images using these scripts. Make them fly, light up, turn static, all without paying the cost of slow downloading time.'

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}

}

function appear(){
document.d1.visibility='show'
}

window.onload=regenerate2
</script>

<div style="text-align: left">
<div onmouseover="changetext(content[4])"> </div> &nbsp;
<table border="0" style="z-index: 102; left: 48px; width: 768px; position: absolute;
top: 268px; height: 327px">
<tr>
<td style="width: 54%">
<div id="scriptmenu" style="line-height: 20px">
<p>
<img src="pragerBookInventory.gif" onmouseover="changetext(content[0])">
<br />
<img src="pragerPricingProgram.gif" onmouseover="changetext(content[1])">
<br />
<img src="pragerListingSynchronizer.gif" onmouseover="changetext(content[2])">
<br />
<img src="pragerRepricingService.gif" onmouseover="changetext(content[3])">
</div>
</td>
<td style="width: 114%">
<div id="descriptions" align="left">
<!--Change below to default content of your own-->
<strong><span style="font-size: 10pt; left: 434px; position: absolute; top: 12px;
z-index: 100; width: 320px; height: 304px;">Hope you like the new look for Prager,
Software. If you take your mouse and "hover" over each link to the left, you will
see a description of that product in this area.</span></strong>
<!--Stop editting-->
</div>
</td>
</tr>
</table>
<div onmouseover="changetext(content[4])"> </div> &nbsp;
</div>

</asp:Content>

jscheuer1
12-15-2006, 08:57 PM
I'm not sure if I did anything of the sort, see this demo:

http://home.comcast.net/~jscheuer1/side/textual_tooltip_h.htm

rmmarsh
12-15-2006, 11:12 PM
Hi John... must have been a pilot error on my part...:)

One more question: I assume that there is no problem putting this in an .aspx page, right? (seems to work ok)...

Thanks again for your help...

Rolf

jscheuer1
12-16-2006, 01:41 AM
No problem there. As long as it works. Things like that can get tricky if you are trying to include server side generated content but, often (especially if you know your aspx), even that is seamless.