Results 1 to 5 of 5

Thread: Someone help ?

  1. #1
    Join Date
    Aug 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Someone help ?

    Ok this is what I am trying to do. If you would kindly take a look at this page:

    http://www.templatehelp.com/aff/prev...e2.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

  2. #2
    Join Date
    Aug 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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/dynamici...iongallery.htm

    http://www.dynamicdrive.com/dynamici...geselector.htm

    http://www.dynamicdrive.com/dynamici...ightslide2.htm


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

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You don't need to use Flash for this.
    Code:
    <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>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Aug 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok lol, you can do everything in java (EDIT/ javascript )

    Anyways it would look better in flash.
    Last edited by Goran; 08-10-2005 at 06:02 PM.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    DHTML really is rather powerful - if you take the time and don't mind writing massive amounts of code. Check out the DHTML 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)
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •