Current location: Hot Scripts Forums » General Web Coding » JavaScript » Need help adding a small java code to my site. this should be very easy for you guys!! :O)


Need help adding a small java code to my site. this should be very easy for you guys!! :O)

Reply
  #1 (permalink)  
Old 07-25-11, 07:26 AM
YOURCONNEXX YOURCONNEXX is offline
New Member
 
Join Date: Mar 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Need help adding a small java code to my site. this should be very easy for you guys!! :O)

ok here's a brief description of my problem.

i have a javascript slideshow that i would like to add to my website. its free to use and it came with some coding when downloaded. my problem is this is my first time EVER using java (ive fiddled with php tho) and i cant get the slide show to work on my site. the coding it came with gives you an entire webpage, but i just need the script and the slideshow to go inside a div container by itself instead of being a whole web page

the following is an embedded style i put together that you can simply copy and paste to notepad, save as an html file, and open in your browser (im currently using firefox). all the images etc are already being hosted so you have to do nothing but open it in your browser to see the script working. please show me what i need to get this slide show into a div container by itself. when i do it it appears in the div container but does not work at all and the buttons arent showing either.

Code:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TinySlider - JavaScript Slideshow</title>
<style all="media" title="YourConnexx Media" type="text/css">

* {margin:0; padding:0}
body {font:12px Verdana,Arial; color:#555; background:#222 url(images/bg.jpg) 50% 0 no-repeat}
p {line-height:1.4; margin-bottom:12px}
#wrapper {width:578px; margin:75px auto}

.sliderbutton {float:left; width:32px; padding-top:134px}
.sliderbutton img {cursor:pointer}
.sliderbutton img:hover {background:#666}
#slider {float:left; position:relative; overflow:auto; width:500px; height:300px; border:2px solid #fff; background:#fff}
#slider ul {position:absolute; list-style:none; top:0; left:0}
#slider li {float:left; width:500px; height:300px; padding-right:10px}

.pagination {float:left; list-style:none; height:25px; margin:15px 0 0 32px}
.pagination li {float:left; cursor:pointer; padding:5px 8px; background:#666; border:1px solid #999; margin:0 4px 0 0; text-align:center; color:#222}
.pagination li:hover {background:#777; border:1px solid #bbb; color:#000}
li.current {border:1px solid #ccc; background:#888}

li#content {width:464px; height:270px; padding:15px 28px 15px 18px}
#content h1 {font:22px Georgia,Verdana; margin-bottom:15px; color:#036}




</style>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="wrapper">
	<div>
		<div class="sliderbutton"><img src="images/left.gif" width="32" height="38" alt="Previous" onclick="slideshow.move(-1)" /></div>
		<div id="slider">
			<ul>
				<li id="content">
					<h1>TinySlider - Simple JavaScript Slideshow</h1>
					<p>This super lightweight (1.5 KB) sliding JavaScript slideshow script can easily be customized to integrate with any website through CSS. You can add any content to it, not just images, and it gracefully degrades without JavaScript support. The script supports automatic rotation with the option to auto-resume, an active class on a navigation list if applicable, and a direction toggle (vertical or horizontal).</p>
					<p><em>For complete details visit <a href="http://www.leigeber.com/">leigeber.com</a>.</em></p>
				</li>
				<li><img src="photos/sea-turtle.jpg" width="500" height="300" alt="Sea turtle" /></li>
				<li><img src="photos/coral-reef.jpg" width="500" height="300" alt="Coral Reef" /></li>
				<li><img src="photos/blue-fish.jpg" width="500" height="300" alt="Blue Fish" /></li>
			</ul>
		</div>
		<div class="sliderbutton"><img src="images/right.gif" width="32" height="38" alt="Next" onclick="slideshow.move(1)" /></div>
	</div>
	<ul id="pagination" class="pagination">
		<li onclick="slideshow.pos(0)">1</li>
		<li onclick="slideshow.pos(1)">2</li>
		<li onclick="slideshow.pos(2)">3</li>
		<li onclick="slideshow.pos(3)">4</li>
	</ul>
</div>
<script type="text/javascript">
var slideshow=new TINY.slider.slide('slideshow',{
	id:'slider',
	auto:3,
	resume:true,
	vertical:false,
	navid:'pagination',
	activeclass:'current',
	position:0
});
</script>
</body>
</html>
im sure one of you guys who knows much more about java and coding than me can do this pretty easy .... maybe its something small im over looking but i cant quite get it
Reply With Quote
  #2 (permalink)  
Old 11-21-11, 02:45 PM
DLJ DLJ is offline
Newbie Coder
 
Join Date: Nov 2011
Location: 303 See Other
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Did you retrieve the javascript source from here?
Code:
<script type="text/javascript" src="script.js"></script>
It's completely non-functional without having a root domain, unless you have it hosted so we can see it live.

Also, you mentioned issues with div, and you're using firefox. I don't use firefox very often, but I do know that some versions have problems parsing div. Try it in Chrome and see how it works.

Last edited by DLJ; 11-21-11 at 02:48 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE6 Bug? My center column drops to footer position goatchaps CSS 5 08-31-07 12:15 PM
HELP :: site navigation interactive java :: HELP aerolex JavaScript 3 09-24-04 04:39 PM
Porting java to C++! addit Everything Java 0 09-06-04 01:03 PM
perl/cgi newbie. hangman.cgi script adding html-like code on web and other trouble Arowana Perl 12 11-13-03 02:24 PM
Validation code for site membership kNIGits The Lounge 1 07-28-03 02:41 AM


All times are GMT -5. The time now is 02:04 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.