+ Reply to Thread
Results 1 to 3 of 3

Thread: Need Java Help!

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    3

    Need Java Help!

     
    I would like to have two image as soon as you go to the webpage it grows to a certain size and stays that size. Along with a Click her to enter button in the center. The title of the website and the background image. Here is the website link on what i'm working on: Home
    It will just be the title and image only with the button then another page when you click enter.

    Please help I'm stuck on this.

  2. #2
    Junior Member
    Join Date
    Mar 2009
    Posts
    3

    Coding

    I have it to grow big on a click but how do I change it so the click isn't required? I figured you have to change the text in red to do it I just don't know the command to do it.



    <script type="text/javascript">
    var links = document.getElementsByTagName('a');
    for (var i = 0; i < links.length; i++)
    if (links[i].className == 'livethumbnail')
    {
    var img = links[i].getElementsByTagName('img')[0];
    img.state = 'small';
    img.smallSrc = img.getAttribute('src');
    img.smallWidth = parseInt(img.getAttribute('width'));
    img.smallHeight = parseInt(img.getAttribute('height'));
    img.largeSrc = links[i].getAttribute('href');
    img.largeWidth = parseInt(img.getAttribute('largewidth'));
    img.largeHeight = parseInt(img.getAttribute('largeheight'));
    img.ratio = img.smallHeight / img.smallWidth;
    links[i].onclick = scale;
    }

    function scale()
    {
    var img = this.getElementsByTagName('img')[0];
    img.src = img.smallSrc;

    if (! img.preloaded)
    {
    img.preloaded = new Image();
    img.preloaded.src = img.largeSrc;
    }
    var interval = window.setInterval(scaleStep, 10);
    return false;

    function scaleStep()
    {
    var step = 10;
    var width = parseInt(img.getAttribute('width'));
    var height = parseInt(img.getAttribute('height'));

    if (img.state == 'small')
    {
    width += step;
    height += Math.floor(step * img.ratio);

    img.setAttribute('width', width);
    img.setAttribute('height', height);

    if (width > img.largeWidth - step)
    {
    img.setAttribute('width', img.largeWidth);
    img.setAttribute('height', img.largeHeight);
    img.setAttribute('src', img.largeSrc);
    window.clearInterval(interval);
    img.state = 'large';
    }
    }

    }
    }
    </script>
    Last edited by fhack2; March 11th, 2009 at 12:22 PM. Reason: Change

  3. #3
    Junior Member
    Join Date
    Mar 2009
    Posts
    3
    Why is it no body on any forum I ask replying. I just need to find out how to do this. My counslor I'm making the website for keeps bugging me and I don't know how to do it. I got that fair and no replies on how to fix.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Launching Java webpages with different Java settings?
    By LostBok in forum Webmastering and Programming
    Replies: 1
    Last Post: December 11th, 2006, 03:38 AM
  2. java.
    By dingdong in forum Webmastering and Programming
    Replies: 10
    Last Post: May 17th, 2005, 07:38 PM
  3. need java help!
    By yohon125 in forum Webmastering and Programming
    Replies: 2
    Last Post: May 6th, 2003, 08:17 PM
  4. XP and Java VM
    By RustyGT in forum Applications and Operating Systems
    Replies: 5
    Last Post: August 22nd, 2002, 01:08 PM
  5. Java Vm
    By snread in forum Applications and Operating Systems
    Replies: 9
    Last Post: August 4th, 2002, 12:15 PM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews