PDA

View Full Version : Someone help ?



phatruss
08-10-2005, 01:38 AM
Ok this is what I am trying to do. If you would kindly take a look at this page:

http://www.templatehelp.com/aff/preview.php?aff=coolhomepages&skin=22&locale=en&currency=0&pr=yes&src=yes&nt=yes&help=yes&sample=yes&faq=yes&nmg=yes&auth=yes&down=yes&chm=&hide_flash=0&search=&PHPSESSID=aa542ba9363d1d51f823461b1e768be1&referer=http%3A%2F%2Fwww.coolhomepages.com%2Fstore%2Ftemplatemonster_page2.html&i=8851

the images are controlled by little links on the bottom. I am trying to achieve this through some scripting. I think I may have something. (I am by no means a coder myself, I just like to tinker and mess around). This is the code I have.

Can someone who is good at this tell me how I can change/add my code to get the effect I am looking for ???




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>

<script language="JavaScript1.2" type="text/javascript">
var current = 1


function loadintoIframe(iframeid, url){
if (document.getElementById)
document.headerpic.src=url

}
function nextpage()
{
if (current >=6) {
current = 1
} else {
current = current + 1;
}
document.headerpic.src=current+".html";
}

function prevpage()
{
if (current <=1) {
current = 6
} else {
current = current - 1;
}
document.headerpic.src=current+".html";
}

</script>




</head>

<body bgcolor="#FF9F40" leftmargin=0 topmargin=0>

<table width="660" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="White">
<tr valign="top">
<td valign="top" align="center">
<iframe src="1.html" name="headerpic" id="headerpic" width="660" height="290" marginwidth="0" marginheight="0" align="middle" scrolling="no" frameborder="0"></iframe>
</td>
</tr>
<tr>
<td align="center">
<form>
<img src="leftarrow.gif" onclick='prevpage()' value='PREVIOUS' javascript:loadintoIframe('headerpic')>
<img src="rightarrow.gif" onclick='nextpage()' value='NEXT' javascript:loadintoIframe('headerpic')>

</form>
</td>
</tr>

</table>




</body>
</html>



I know what I have there is probally totally wrong. But I am trying...


Thanks,

Russ

Goran
08-10-2005, 08:25 AM
Use Flash and save yourslef some coding time. If you don't know how to use flash, you can use some of Gallery codes from these site. Here are some links:


http://www.dynamicdrive.com/dynamicindex17/agallery.htm

http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

http://www.dynamicdrive.com/dynamicindex4/imageselector.htm

http://www.dynamicdrive.com/dynamicindex14/leftrightslide2.htm


If you search a little more you ll find more for sure.

Twey
08-10-2005, 09:01 AM
You don't need to use Flash for this.

<script type="text/javascript">
var images = new Array("imageone.jpg", "imagetwo.jpg", "imagethree.jpg");
var titles = new Array("First picture", "Second picture", "Third picture");
var currImg = 0;

function nextImage(img, txt) {
currImg++;
if(currImg == images.length) currImg = 0;
img.src = images[currimg];
txt.innerHTML = titles[currimg];
}

function lastImage(img, txt) {
currImg--;
if(currImg == -1) currImg = images.length;
img.src = images[currimg];
txt.innerHTML = titles[currimg];
}
</script>
<img id="theImg" src="imageone.jpg"/><br/>
<p id="theTxt">First image</p>
<a href="listOfImages.htm" onclick="lastImage(document.getElementById('theImg'), document.getElementById('theTxt'));return false;">Previous</a>
<a href="listOfImages.htm" onclick="nextImage(document.getElementById('theImg'), document.getElementById('theTxt'));return false;">Next</a>

Goran
08-10-2005, 05:46 PM
Ok lol, you can do everything in java (EDIT/ javascript :rolleyes: )

Anyways it would look better in flash.

Twey
08-10-2005, 05:55 PM
DHTML really is rather powerful - if you take the time and don't mind writing massive amounts of code. Check out the DHTML Lemmings (http://193.151.73.87/games/lemmings/).

It wouldn't necessarily look better in Flash - depends what effects you applied. It could look purty in DHTML, too - add some fading/scrolling effects, make the buttons look good...


in java
-.- (points to the sig)