Log ind for at få flere funktioner

  • 22-10-2005 · 12:21 243 visninger 4 svar
  • Denne tråd er over 6 måneder gammel

    Er du sikker på, at du har noget relevant at tilføje?

  • Sortitoutsi news ticker

    Af Zor gæst
http://www.sortitoutsi.net

Supér news ticker. Nogen der ved om man kan hente sådan en ned :o) ?

På forhånd tak ;)
Zor

#1

Gæst
26-10-2005 11:34
Hmm any1 :P ?
KC

#2

Elitebruger
26-10-2005 11:38
Se koden:

<script type="text/javascript">
<!--
// Ticker startup
function startTicker()
{
// Define run time values
theCurrentStory = -1;
theCurrentLength = 0;
// Locate base objects
if (document.getElementById) {
theAnchorObject = document.getElementById("tickerAnchor");
runTheTicker();
}
else {
document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
return true;
}
}
// Ticker main run loop
function runTheTicker()
{
var myTimeout;
// Go for the next story data block
if(theCurrentLength == 0)
{
theCurrentStory++;
theCurrentStory = theCurrentStory % theItemCount;
theStorySummary = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
theTargetLink = theSiteLinks[theCurrentStory];
theAnchorObject.href = theTargetLink;
thePrefix = "<span class="tickls">" + theLeadString + "</span>";
}
// Stuff the current ticker text into the anchor
theAnchorObject.innerHTML = thePrefix +
theStorySummary.substring(0,theCurrentLength) + whatWidget();
// Modify the length for the substring and define the timer
if(theCurrentLength != theStorySummary.length)
{
theCurrentLength++;
myTimeout = theCharacterTimeout;
}
else
{
theCurrentLength = 0;
myTimeout = theStoryTimeout;
}
// Call up the next cycle of the ticker
setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
if(theCurrentLength == theStorySummary.length)
{
return theWidgetNone;
}

if((theCurrentLength % 2) == 1)
{
return theWidgetOne;
}
else
{
return theWidgetTwo;
}
}
// -->
</script>


<script type="text/javascript">
<!--

var theCharacterTimeout = 50;
var theStoryTimeout = 5000;
var theWidgetOne = "_";
var theWidgetTwo = "-";
var theWidgetNone = "";
var theLeadString = "";

var theSummaries = new Array();
var theSiteLinks = new Array();

var theItemCount = 10;


theSummaries[9] = "";
theSiteLinks[9] = "";

theSummaries[8] = "Take part in the one and only Susie Super League...";
theSiteLinks[8] = " http://www.sortitoutsi.net/forums/i......

theSummaries[7] = "Make your voice heard! Susie Super League";
theSiteLinks[7] = " http://www.sortitoutsi.net/forums/i......

theSummaries[6] = "Try out the Football Manager 2006 BETA Demo! Click here for more information";
theSiteLinks[6] = "index.php?page=articles&view=news&news_id=1679";

theSummaries[5] = "FM2006 Gold Demo Released. Get it Now!";
theSiteLinks[5] = " http://www.sortitoutsi.net/index.ph......

theSummaries[4] = "Patch 6.0.1 For Football Manager 2006 Released";
theSiteLinks[4] = " http://www.sortitoutsi.net/index.ph......

theSummaries[3] = "Join sortitoutsi.net! Become a Staff Member Today!";
theSiteLinks[3] = " http://www.sortitoutsi.net/index.ph......

theSummaries[2] = "";
theSiteLinks[2] = "";

theSummaries[1] = "";
theSiteLinks[1] = "";

theSummaries[0] = "";
theSiteLinks[0] = "";


startTicker();

//-->
</script>
Zor

#3

Gæst
26-10-2005 12:04
Tak. Jeg ser følgende:

theSummaries[3] = "Take part in the one and only Susie Super League...";
theSiteLinks[3] = " http://www.sortitoutsi.net/forums/i......

Hvordan får man den til at vælge den 3. nyeste nyhed fra mySQL eksempelvis? :-P
KC

#4

Elitebruger
27-10-2005 22:01
$swl = mysql_select("SELECT * FROM news LIMIT 3,1 ORDER BY time");

ret selv til...
Bruger påkrævet
En bruger er påkrævet for at oprette svar på Hardwareonline.dk
Du kan oprette en bruger her eller logge ind her

Log ind for at få flere funktioner