Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 04:15:06 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 51
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 54
Total: 54

Author Topic: Links Ticker  (Read 15194 times)

0 Members and 1 Guest are viewing this topic.

crip

  • Guest
Links Ticker
« on: March 13, 2006, 11:44:00 AM »
This is a nice little Links Ticker, for use in a script block .. kinda neat.. you can change the way it looks , width + height..ticker speed et-ceteras.. Add as many links as wanted without taking up much space @ all ..

Code: [Select]
<style>
<!--
.scrollerstyle{
font-family:webdings;background:#dbdbdb;border:1px solid #000000;cursor:hand;
}
-->
</style>

<script language="javascript">

//News Bar script- By Premshree Pillai (premshree@hotmail.com)
//http://www.qiksearch.com/javascripts.htm
//Enhancements by Dynamic Drive
//Visit http://www.dynamicdrive.com for this script

 var msgs = new Array(
     "Simple Machines",
     "Dynamic Drive",
     "The BlocZone.net",
     "JavaScript Kit",
     "Freewarejava",
     "Google Search",
     "Yahoo Search",
     "MSN Search",
     "Ask Jeeves",
     "Dogpile Search",
     "AltaVista",
     "Wired News",
     "Qiksearch" ); // No comma after last ticker msg

 var msg_url = new Array(
     "http://www.simplemachines.org",
     "http://www.dynamicdrive.com",
     "http://www.tinyportal.co.uk",
     "http://www.javascriptkit.com",
     "http://freewarejava.com",
     "http://www.google.com",
     "http://www.yahoo.com",
     "http://www.msn.com",
     "http://www.askjeeves.com",
     "http://www.dogpile.com",
     "http://www.altavista.com",
     "http://www.wired.com",
     "http://www.qiksearch.com" ); // No comma after last ticker url

var barwidth='120px' //Enter main bar width in px or %
var setdelay=3000 //Enter delay between msgs, in mili-seconds
var mouseover_color='#cccccc' //Specify highlight color
var mouseout_color='#dbdbdb' //Specify default color
/////////////////////////////////////////////////////////////////////

var count=0;
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

if (ie4||ns6){
document.write('<form name="news_bar"><input type="button" value="3" onclick="moveit(0)" class="scrollerstyle" style="width:22px; height:22px; border-right-width:0px;" name="prev" title="Previous News"><input type="button" name="news_bar_but" onclick="goURL();" style="color:#000000;background:#dbdbdb; width:'+barwidth+'; height:22px; border-width:1; border-color:#000000; cursor:hand" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"><input type="button" value="4" onclick="moveit(1)" class="scrollerstyle" style="width:22px; height:22px; border-left-width:0px;" name="next" title="Next News"></form>');
}
else{
document.write('<form name="news_bar"><input type="button" value="Previous" onclick="moveit(0)">')
if (navigator.userAgent.indexOf("Opera")!=-1)
document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="width:'+barwidth+'" border="0">')
else
document.write('<input type="button" name="news_bar_but" onclick="goURL();" width="'+barwidth+'" border="0">')
document.write('<input type="button" value="Next" onclick="moveit(1)"></form>')
}

function init_news_bar(){
  document.news_bar.news_bar_but.value=msgs[count];
}
//moveit function by Dynamicdrive.com
function moveit(how){
if (how==1){ //cycle foward
if (count<msgs.length-1)
count++
else
count=0
}
else{ //cycle backward
if (count==0)
count=msgs.length-1
else
count--
}
document.news_bar.news_bar_but.value=msgs[count];
}

setInterval("moveit(1)",setdelay)

function goURL(){
 location.href=msg_url[count];
}

init_news_bar();
</script>


.

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: Links Ticker
« Reply #1 on: March 13, 2006, 03:03:01 PM »
It would be nice to have a Screenshot or a demo for stuff like this.

gerrymo

  • Guest
Re: Links Ticker
« Reply #2 on: March 13, 2006, 03:09:20 PM »
This looks like the right page. Demo included. Its not what I thought it was.

http://dynamicdrive.com/dynamicindex2/newsbar.htm

TwinsX2Dad

  • Guest
Re: Links Ticker
« Reply #3 on: March 13, 2006, 03:10:31 PM »
Here's your demo, pal.......

http://www.dynamicdrive.com/dynamicindex2/newsbar.htm

Oh wait - we got your screenshot too!   ;D

[attachment deleted by admin]

TwinsX2Dad

  • Guest
Re: Links Ticker
« Reply #4 on: March 13, 2006, 03:13:41 PM »
You wouldn't have snuck in under me, gerrymo, if you'd also taken the time to do the screenshot.   :knuppel2:

crip

  • Guest
Re: Links Ticker
« Reply #5 on: March 13, 2006, 03:37:23 PM »
Lol..i figured that was coming..

  • Demo

    you can see it tick..in FF /3/ previous \4\ next..IE your see:  > xxxxxxxxxxxxxxxx < .. just click it..lol.. ;D

    crip~

crip

  • Guest
Re: Links Ticker
« Reply #6 on: March 13, 2006, 03:38:55 PM »
see, i told ya i was slow...

Mitch

  • Guest
Re: Links Ticker
« Reply #7 on: March 13, 2006, 04:57:49 PM »
Hahaha nice. I thought by the description it was a scrolling one which I was looking for. :P

daftdate

  • Guest
Re: Links Ticker
« Reply #8 on: March 15, 2006, 03:31:13 AM »
Now guys play nice, I was just wondering how you would get it so that the link opens up in a seperate window so they dont navigate away from the forum.  Im not a java script person or web person im more of a vb.net, pascal, cobol type of gal so have been looking to see how to do it.  i understand the script how it calls the array and how the ticker works but not sure were to insert target="_blank" or target="new" if thats what i put in.  :)

daftdate

  • Guest
Re: Links Ticker
« Reply #9 on: March 16, 2006, 10:26:30 AM »
As no one gave me any help i decided to try and mess around with it myself and here we are.  I changed the gourl function so it would call up a new browser window.  :) it might be simple stuff to you guys but i will get there in the end.  :)
Code: [Select]
<style>
<!--
.scrollerstyle{
font-family:webdings;background:#dbdbdb;border:1px solid #000000;cursor:hand;
}
-->
</style>

<script language="javascript">

//News Bar script- By Premshree Pillai (premshree@hotmail.com)
//http://www.qiksearch.com/javascripts.htm
//Enhancements by Dynamic Drive
//Visit http://www.dynamicdrive.com for this script

 var msgs = new Array(
     "Simple Machines",
     "Third Wave",
     "The BlocZone.net",
     "JT3K!",
     "Mr Toms World",
     "Google Search",
     "Yahoo Search",
     "MSN Search",
     "Ask Jeeves",
     "Dogpile Search",
     "AltaVista",
     "Wired News",
     "Bottle of Beer" ); // No comma after last ticker msg

 var msg_url = new Array(
     "http://www.simplemachines.org",
     "http://isa.wolvcoll.ac.uk/moodle",
     "http://www.tinyportal.co.uk",
     "http://www.jt3k.com/home",
     "http://wwwmrtomsworld.co.uk",
     "http://www.google.com",
     "http://www.yahoo.com",
     "http://www.msn.com",
     "http://www.askjeeves.com",
     "http://www.dogpile.com",
     "http://www.altavista.com",
     "http://www.wired.com",
     "http://www.bottleofbeer.co.uk" ); // No comma after last ticker url
var newwindow = ' ';
var barwidth='120px' //Enter main bar width in px or %
var setdelay=3000 //Enter delay between msgs, in mili-seconds
var mouseover_color='#cccccc' //Specify highlight color
var mouseout_color='#dbdbdb' //Specify default color
/////////////////////////////////////////////////////////////////////

var count=0;
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

if (ie4||ns6){
document.write('<form name="news_bar"><input type="button" value="3" onclick="moveit(0)" class="scrollerstyle" style="width:22px; height:22px; border-right-width:0px;" name="prev" title="Previous News"><input type="button" name="news_bar_but"onclick="goURL();" style="color:#000000;background:#dbdbdb; width:'+barwidth+'; height:22px; border-width:1; border-color:#000000; cursor:hand" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"><input type="button" value="4" onclick="moveit(1)" class="scrollerstyle" style="width:22px; height:22px; border-left-width:0px;" name="next" title="Next News"></form>');
}
else{
document.write('<form name="news_bar"><input type="button" value="Previous" onclick="moveit(0)">')
if (navigator.userAgent.indexOf("Opera")!=-1)
document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="width:'+barwidth+'" border="0">')
else
document.write('<input type="button" name="news_bar_but"onclick="goURL();" width="'+barwidth+'" border="0">')
document.write('<input type="button" value="Next" onclick="moveit(1)"></form>')
}

function init_news_bar(){
  document.news_bar.news_bar_but.value=msgs[count];
}
//moveit function by Dynamicdrive.com
function moveit(how){
if (how==1){ //cycle foward
if (count<msgs.length-1)
count++
else
count=0
}
else{ //cycle backward
if (count==0)
count=msgs.length-1
else
count--
}
document.news_bar.news_bar_but.value=msgs[count];
}

setInterval("moveit(1)",setdelay)

function goURL(){
if (!newwindow.closed && newwindow.location)

{
        newwindow.location.href = msg_url[count];
}

else

{

      newwindow = window.open (msg_url[count], 'name', 'width=600,height=800,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');

    if (!newwindow.opener) newwindow.opener = self;

}

if (window.focus) {newwindow.focus()}
return false;



}

init_news_bar();
</script>
« Last Edit: January 09, 2007, 12:24:15 PM by crip »