PDA

View Full Version : Scrolling Problem. Message doesnt scroll on page scrolling



mrsea001
02-01-2009, 07:23 PM
1) Script Title: Always-on-top message

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex10/topmsg.htm

3) Describe problem:

I am facing a problem with Dynamic Drive's Script especially those what made for scrolling. Many of Text Animation Scripts are not working properly in my local project however those all are perfectly working in this site show as Demo.

For example: Always-on-top message Script is working properly as shown in Demo at this site. But when I try in my project It just displays at the bottom of page instead to move on page scrolling up/down. I am using IE 6.0 XP builtin browser.

Link the script at this site: http://www.dynamicdrive.com/dynamicindex10/topmsg.htm

I was testing this script in Asp.Net 2.0, so I thought it might not working with .Net 2.0 but I checked in html also the same problem I have faced. Many of text animation scrolling script are not working in my project.

Please help what am I making mistake :confused:

Snookerman
02-01-2009, 07:25 PM
Please post a link to the page on your site that contains the problematic script or attach your code so we can check it out and help you.

mrsea001
02-02-2009, 12:00 PM
here is the whole code of my page. I am developing a page so, It not online yet!.

Please see the code bellow: I am working in Aspx.
//Html Code*************************

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="alwaysontop.aspx.cs" Inherits="alwaysontop" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">

//Always-on-top message Script- Dynamic Drive (www.dynamicdrive.com)
//For full source code, and Terms Of use, visit dynamicdrive.com
//This credit MUST stay intact for use

//enter the message you wish to be shown, including html tags
var message='<b><font color=000000 size=5>Help us spread the word. Please <a href="../link.htm">link to us</a>!</font></b>'

//enter a color name or hex to be used as the background color of the message
var backgroundcolor="#FFFF8A"

//enter 1 for always display, 2 for ONCE per browser session
var displaymode=1

//Set duration message should appear on screen, in seconds (10000=10 sec, 0=perpetual)
var displayduration=0

//enter 0 for non-flashing message, 1 for flashing
var flashmode=1
//if above is set to flashing, enter the flash-to color below
var flashtocolor="lightyellow"


///////////////do not edit below this line////////////////////////////////////////
var ie=document.all
var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1

function regenerate(){
window.location.reload()
}

function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}

var which=0

function flash(){
if (which==0){
if (document.layers)
topmsg_obj.bgColor=flashtocolor
else
topmsg_obj.style.backgroundColor=flashtocolor
which=1
}
else{
if (document.layers)
topmsg_obj.bgColor=backgroundcolor
else
topmsg_obj.style.backgroundColor=backgroundcolor
which=0
}
}

if (ie||document.getElementById)
document.write('<div id="topmsg" style="position:absolute;visibility:hidden">'+message+'</div>')

var topmsg_obj=ie? document.all.topmsg : document.getElementById? document.getElementById("topmsg") : document.topmsg

function positionit(){
var dsocleft=ie? document.body.scrollLeft : pageXOffset
var dsoctop=ie? document.body.scrollTop : pageYOffset
var window_width=ieNOTopera? document.body.clientWidth : window.innerWidth-20
var window_height=ieNOTopera? document.body.clientHeight : window.innerHeight

if (ie||document.getElementById){
topmsg_obj.style.left=parseInt(dsocleft)+window_width/2-topmsg_obj.offsetWidth/2
topmsg_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-topmsg_obj.offsetHeight-4
}
else if (document.layers){
topmsg_obj.left=dsocleft+window_width/2-topmsg_obj.document.width/2
topmsg_obj.top=dsoctop+window_height-topmsg_obj.document.height-5
}
}

function setmessage(){
if (displaymode==2&&(!display_msg_or_not()))
return
if (document.layers){
topmsg_obj=new Layer(window.innerWidth)
topmsg_obj.bgColor=backgroundcolor
regenerate2()
topmsg_obj.document.write(message)
topmsg_obj.document.close()
positionit()
topmsg_obj.visibility="show"
if (displayduration!=0)
setTimeout("topmsg_obj.visibility='hide'",displayduration)
}
else{
positionit()
topmsg_obj.style.backgroundColor=backgroundcolor
topmsg_obj.style.visibility="visible"
if (displayduration!=0)
setTimeout("topmsg_obj.style.visibility='hidden'",displayduration)
}
setInterval("positionit()",100)
if (flashmode==1)
setInterval("flash()",1000)
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function display_msg_or_not(){
if (get_cookie("displaymsg")==""){
document.cookie="displaymsg=yes"
return true
}
else
return false
}

if (document.layers||ie||document.getElementById)
window.onload=setmessage
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
Testing always on top message <br />
</div>
</form>
</body>
</html>

//End Code *************************