Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Services > Web Designing and Development

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2008, 06:54 PM
new member
 
Join Date: May 2008
Posts: 6
Default A new simple way to make a image slider- Javascript Code

Hi all!
I found that is difficult to search a simple javascript code about scrolling image slide. You can find them on Internet but they often are long and complex or hidden from us to prevent edit.
I just found a simple way to resolve this. I hope it will help your editting easier to make it yours!
We need 2 div tag to make a slide. ChildDiv to store image array and ParentDiv to contain Child Div.

Note:
Image Array's Structure: [, , ]
Functions:
DoSlide(), Make Slide to run.
setmouse(param), set Slide play and pause when pointer over or out on images;
Dr_ImgArr(); Print image array to HTML;
getE(), getElementById();
DivWidth: Width of ParentDiv;
MoreImage: Num Of Image on a begin of Image Array, insert into the last of ChildDiv to continue the Slide;
....
If you have anymore comment, please reply here so that I can make it more perfect,
thank for all.
Demo: Style
Code:
Javascript
Code:
HTML Body

Code:
  #2 (permalink)  
Old 05-20-2008, 06:21 PM
Cassie's Avatar
Premium Member
 
Join Date: May 2007
Location: Cambridgeshire
Posts: 336
Default

is it just me or are those boxes blank
  #3 (permalink)  
Old 05-20-2008, 07:58 PM
Pumazooma's Avatar
Senior Member
 
Join Date: Jun 2006
Location: Oxford
Posts: 271
Default

I just did a search for the first line of text.

It's a spambot.

And yes, the boxes are blank. i suspect its either to spam the link in the demo or the demo page contains a nasty.
  #4 (permalink)  
Old 05-20-2008, 09:10 PM
new member
 
Join Date: May 2008
Posts: 6
Default

This forum is error on my post html tags in CODE VBB tag
So I post again to show all in HTML VBB tag. This code is my found and i want to share for all in many forum.
@Pumazooma: I'm Not Spam Bot so you shouldn't said so. You need copy code in HTML tag into html file and make image list yourself for check how fine do this code do.

Hi all!
I found that is difficult to search a simple javascript code about scrolling image slide. You can find them on Internet but they often are long and complex or hidden from us to prevent edit.
I just found a simple way to resolve this. I hope it will help your editting easier to make it yours!
We need 2 div tag to make a slide. ChildDiv to store image array and ParentDiv to contain Child Div.

Note:
Image Array's Structure: [Image's Link , Image's Width, URL to Go]
Functions:
DoSlide(), Make Slide to run.
setmouse(param), set Slide play and pause when pointer over or out on images;
Dr_ImgArr(); Print image array to HTML;
getE(), getElementById();
DivWidth: Width of ParentDiv;
MoreImage: Num Of Image on a begin of Image Array, insert into the last of ChildDiv to continue the Slide;
....
If you have anymore comment, please reply here so that I can make it more perfect,
thank for all.
Demo:
Style
HTML Code:
<style>
#ParentDiv
{
	margin: auto;
	width: 600px;
	overflow: hidden;
}

#ChildDiv
{
	width: 6000px; 
	position:relative;
	cursor:pointer;
}
#ParentDiv img
{
float: left;
padding: 3px;
margin: 0px;
}
</style>
Javascript
HTML Code:
<script>
//Array Of Image, [ URL, width of Image, LinkTo]
var t;
var StepTime=10;
var StepPixel=1;
var ImgPadding=3;
var ParentDivLen=600;
var Img= Array(
["./images/slide/3_116.jpg", 104, "../gal/?gal=3&Type=image&ID=116"], 
["./images/slide/4_250.jpg", 103, "../gal/?gal=4&Type=image&ID=250"], 
["./images/slide/1_157.jpg", 107, "../gal/?gal=1&Type=image&ID=157"], 
["./images/slide/2_120.jpg", 124, "../gal/?gal=2&Type=image&ID=120"], 
["./images/slide/4_229.jpg", 116, "../gal/?gal=4&Type=image&ID=229"], 
["./images/slide/3_173.jpg", 113, "../gal/?gal=3&Type=image&ID=173"], 
["./images/slide/2_192.jpg", 110, "../gal/?gal=2&Type=image&ID=192"], 
["./images/slide/4_111.jpg", 104, "../gal/?gal=4&Type=image&ID=111"], 
["./images/slide/5_244.jpg", 106, "../gal/?gal=5&Type=image&ID=244"], 
["./images/slide/5_279.jpg", 109, "../gal/?gal=5&Type=image&ID=279"], 
["./images/slide/5_233.jpg", 102, "../gal/?gal=5&Type=image&ID=233"], 
["./images/slide/5_256.jpg", 106, "../gal/?gal=5&Type=image&ID=256"], 
["./images/slide/5_248.jpg", 111, "../gal/?gal=5&Type=image&ID=248"], 
["./images/slide/3_143.jpg", 99, "../gal/?gal=3&Type=image&ID=143"], 
["./images/slide/1_225.jpg", 103, "../gal/?gal=1&Type=image&ID=225"], 
["./images/slide/4_103.jpg", 109, "../gal/?gal=4&Type=image&ID=103"], 
["./images/slide/4_145.jpg", 118, "../gal/?gal=4&Type=image&ID=145"], 
["./images/slide/5_263.jpg", 100, "../gal/?gal=5&Type=image&ID=263"], 
["./images/slide/2_115.jpg", 102, "../gal/?gal=2&Type=image&ID=115"], 
["./images/slide/4_140.jpg", 122, "../gal/?gal=4&Type=image&ID=140"], 
["./images/slide/1_214.jpg", 112, "../gal/?gal=1&Type=image&ID=214"], 
["./images/slide/3_142.jpg", 102, "../gal/?gal=3&Type=image&ID=142"], 
["./images/slide/5_297.jpg", 99, "../gal/?gal=5&Type=image&ID=297"], 
["./images/slide/4_168.jpg", 101, "../gal/?gal=4&Type=image&ID=168"], 
["./images/slide/5_277.jpg", 111, "../gal/?gal=5&Type=image&ID=277"], 
["./images/slide/5_296.jpg", 103, "../gal/?gal=5&Type=image&ID=296"], 
["./images/slide/4_169.jpg", 109, "../gal/?gal=4&Type=image&ID=169"], 
["./images/slide/4_244.jpg", 110, "../gal/?gal=4&Type=image&ID=244"], 
["./images/slide/5_285.jpg", 112, "../gal/?gal=5&Type=image&ID=285"], 
["./images/slide/3_100.jpg", 111, "../gal/?gal=3&Type=image&ID=100"], 
["./images/slide/1_103.jpg", 111, "../gal/?gal=1&Type=image&ID=103"], 
["./images/slide/1_119.jpg", 104, "../gal/?gal=1&Type=image&ID=119"], 
["./images/slide/5_253.jpg", 107, "../gal/?gal=5&Type=image&ID=253"], 
["./images/slide/4_183.jpg", 105, "../gal/?gal=4&Type=image&ID=183"], 
["./images/slide/4_171.jpg", 111, "../gal/?gal=4&Type=image&ID=171"], 
["./images/slide/2_147.jpg", 126, "../gal/?gal=2&Type=image&ID=147"], 
["./images/slide/3_115.jpg", 116, "../gal/?gal=3&Type=image&ID=115"], 
["./images/slide/5_310.jpg", 113, "../gal/?gal=5&Type=image&ID=310"], 
["./images/slide/4_185.jpg", 109, "../gal/?gal=4&Type=image&ID=185"], 
["./images/slide/3_159.jpg", 108, "../gal/?gal=3&Type=image&ID=159"], 
["./images/slide/2_154.jpg", 125, "../gal/?gal=2&Type=image&ID=154"], 
["./images/slide/5_314.jpg", 107, "../gal/?gal=5&Type=image&ID=314"], 
["./images/slide/2_106.jpg", 100, "../gal/?gal=2&Type=image&ID=106"], 
["./images/slide/4_123.jpg", 103, "../gal/?gal=4&Type=image&ID=123"]
);
var Pos=0;
var Len=Img.length;

var DivWidth=0;
var MoreImage=0; 

function goURL(URLS)
{
	document.location.href=URLS;
}
for(i=0;i<Len;i++)
{
	DivWidth+=Img[i][1] + ImgPadding*2;
	if(MoreImage==0 && DivWidth>ParentDivLen)MoreImage=i;
}
function getE(id)
{
	return document.getElementById(id);
}

function Dr_Img(IMG)
{
	return '<img src="'+ IMG[0] + '" onclick="goURL(\'' + IMG[2] + '\')">';
}

function Dr_ImgArr()
{
	var str='';
	for(i=0;i<Len;i++) str += Dr_Img(Img[i]);
	for(i=0;i<MoreImage;i++)str += Dr_Img(Img[i]);
	document.write(str);
}

function DoSlide()
{
	if(Pos==0)Pos=-1;
	divtg=getE('ChildDiv');
	Pos-=StepPixel;
	if(Pos<-DivWidth)Pos=0;
	divtg.style.left=Pos +'px';
	t=setTimeout('DoSlide()',StepTime);
	
}

function SlideStop()
{
    clearTimeout(t);
}
function setmouse(id)
{
    if(id==1)
    {
        DoSlide();
    }
    else
    {
        SlideStop();
    }
}
</script>
HTML Body

HTML Code:
<div id="ParentDiv">
	<div id="ChildDiv" onmouseout="setmouse(1);" onmouseover="setmouse(2);">

		<script>
			Dr_ImgArr();
		</script>
	</div>
</div>

Last edited by o0DarkEvil0o; 05-20-2008 at 09:14 PM.
  #5 (permalink)  
Old 05-20-2008, 10:18 PM
Pumazooma's Avatar
Senior Member
 
Join Date: Jun 2006
Location: Oxford
Posts: 271
Default

That exact text is on dozens of forums if you google it. We get a lot of spambots on here and for a first post yours was rather odd to just launch into such a post. And going to your demo page and clicking an image leads to a borderline porn site. It wasn't such a bad assumption to make was it.

Last edited by Pumazooma; 05-20-2008 at 10:20 PM.
  #6 (permalink)  
Old 05-20-2008, 10:27 PM
new member
 
Join Date: May 2008
Posts: 6
Default

Oh uh, porn site? you know wat a porn site?
  #7 (permalink)  
Old 05-21-2008, 08:38 AM
Pumazooma's Avatar
Senior Member
 
Join Date: Jun 2006
Location: Oxford
Posts: 271
Default

Put it this way.

Your example of scrolling images could have had trees, birds, planes, cars, fields, abstract art....... But no. It has upskirt shots of Japanese models in school girl outfits.

You have wonder why that's your example of the code in action.

Last edited by Pumazooma; 05-21-2008 at 08:41 AM.
  #8 (permalink)  
Old 05-21-2008, 11:23 AM
new member
 
Join Date: May 2008
Posts: 6
Default

This is my Code. Haven't you saw it on other author?
And if it's mine, so why do i have to public it's demo to the websites that aren't belong to me?
And if the demo is hosted on my site, so why i have to make other script if it' really available?

And the last, why do demo images must be 'trees, birds, planes, cars, fields, abstract art'?
  #9 (permalink)  
Old 05-21-2008, 11:43 AM
Pumazooma's Avatar
Senior Member
 
Join Date: Jun 2006
Location: Oxford
Posts: 271
Default

I'm not disputing it's your code.

Firstly I'm wondering why you're spamming it on nearly 100 other sites (according to google) and secondly why, in the demo link in your first post, you don't use something it a bit more user friendly like trees or something to demonstrate your scrolling code, rather than soft porn.
  #10 (permalink)  
Old 05-21-2008, 12:53 PM
Senior Member
 
Join Date: Feb 2008
Posts: 205
Default

Googling the thread title in quotes brings up a listing on 165 different sites. Your profile name has even more. I'm sorry but I cant see the point of cross posting this to 100's of forums.
__________________
Midlands Weather Forum
  #11 (permalink)  
Old 05-21-2008, 01:06 PM
new member
 
Join Date: May 2008
Posts: 6
Default

1st Reason: I want to share to all, and this 4rum have limited members.
2nd reason: You should check CODE tag contains error when you post in it html [ less than and greater - open and close of tag]tag, so it don't show correct.
in second post. I have replaced by HTML tag, and you see, it works.
  #12 (permalink)  
Old 05-21-2008, 06:15 PM
Cassie's Avatar
Premium Member
 
Join Date: May 2007
Location: Cambridgeshire
Posts: 336
Default

Does the script work?

If it does work then does it matter if he has spammed lots of sites.

If it doesn't work then Admin please close this post and remove the code.
  #13 (permalink)  
Old 05-21-2008, 06:21 PM
new member
 
Join Date: May 2008
Posts: 6
Default

Hi hi, I posted on many Js site, my code is works fine on IE and FF common. If I want to spam. why I post only topic in this forum instead make many topic?
Closed Thread

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:35 PM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum