JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old June 4th, 2003, 03:24 AM
tim tim is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 62 tim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 9 sec
Reputation Power: 6
Send a message via ICQ to tim
Vertical Scroller

I have the following iframe-based Vertical Scroller code taken from Dynamic Drive, and modified it a little so it's various variable can be controlled by PHP. The problem is, why does it work sometimes and at other times, it jerks up and down when i refresh the page.

Am using IE6. However, when i tried in iE5, it worked consistently.





<?
// this file, external.php is sourced in from iframe's(caller) src property

$nNoticeID = trim($NoticeID);
$nScrollSpeed = 3;
$nInitialFromTop = 10;
$nRate = 50;

?>

<html>
<body>

<div id="datacontainer<?=$nNoticeID?>" style="position:absolute;left:0;top:10;width:100%" onMouseover="scrollspeed=0" onMous
eout="scrollspeed=cache">

<!-- ADD YOUR SCROLLER COMMENT INSIDE HERE--------------------->

<?
$sSqlGetNoticeContent = "select noticecontent from noticeboard where noticeid='$nNoticeID'";
$rsSqlGetNoticeContent = &$sConn->Execute($sSqlGetNoticeContent) or die ("Error: ****!!!");
$sNoticeContent = $rsSqlGetNoticeContent->fields('noticecontent');
$rsSqlGetNoticeContent->Close();
$sConn->Close();

echo $sNoticeContent;
?>

<!-- END SCROLLER CONTENT---------------------------------------->

<div>

<script language="JavaScript1.2">


//<iframe> script by Dynamicdrive.com

//Specify speed of scroll. Larger=faster (ie: 5)
//Adjust scrollspeed and setTimeout timer value to create paused messages
var scrollspeed = cache = <?=$nScrollSpeed?> // this determines how large a step to be taken in
// scrolling (how much 'ground', measured in pixels to be covered)
var divid = <?=$nNoticeID?>;
var initialfromtop = <?=$nInitialFromTop?>;
var rate = <?=$nRate?>;

function initialize(){
// marqueeheight = document.all ? parent.document.all.datamain.height : parent.document.getElementById("datamain").getAt
tribute("height")
// dataobj = document.all ? eval('document.all.datacontainer' + divid) : eval('document.getElementById("datacontainer' +
divid + '")')
dataobj = eval('document.all.datacontainer' + divid)
// dataobj = document.all.datacontainer1

dataobj.style.top = initialfromtop // set to original position
thelength = dataobj.offsetHeight // offsetHeight to get the total length of message

scrolltest()
}

function scrolltest(){
dataobj.style.top = parseInt(dataobj.style.top) - scrollspeed

if (parseInt(dataobj.style.top) < thelength * (-1))
dataobj.style.top = initialfromtop // resets scroller to its original position, higher the number, further away
// the message scroller is from top of IFRAME

setTimeout("scrolltest()", rate) // second argument determines how long you want to pause the message
// before scrolling off again
}

window.onload=initialize

</script>

</body>
</html>




Sorry for being messy, but can anyone help? Thank you
__________________
Beginner

Reply With Quote
  #2  
Old June 18th, 2003, 03:15 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to fakker
is there an online version we could have a look at?

thanks....
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #3  
Old June 23rd, 2003, 03:49 AM
tim tim is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 62 tim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 9 sec
Reputation Power: 6
Send a message via ICQ to tim
which one do you mean? if it's the copy of code i have just posted, no. It's somewhere in www.dynamicdrive.com but i have lost the link to it.

Reply With Quote
  #4  
Old July 9th, 2003, 10:19 PM
tim tim is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 62 tim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 9 sec
Reputation Power: 6
Send a message via ICQ to tim

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Vertical Scroller


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway