Thread: Need Java Help!
-
March 2nd, 2009, 10:29 PM #1Junior 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.
-
March 10th, 2009, 05:32 PM #2Junior 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
-
March 26th, 2009, 09:09 PM #3Junior 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
-
Launching Java webpages with different Java settings?
By LostBok in forum Webmastering and ProgrammingReplies: 1Last Post: December 11th, 2006, 03:38 AM -
java.
By dingdong in forum Webmastering and ProgrammingReplies: 10Last Post: May 17th, 2005, 07:38 PM -
need java help!
By yohon125 in forum Webmastering and ProgrammingReplies: 2Last Post: May 6th, 2003, 08:17 PM -
XP and Java VM
By RustyGT in forum Applications and Operating SystemsReplies: 5Last Post: August 22nd, 2002, 01:08 PM -
Java Vm
By snread in forum Applications and Operating SystemsReplies: 9Last Post: August 4th, 2002, 12:15 PM



LinkBack URL
About LinkBacks



Reply With Quote

Hooked up some audio equipment. Did it first, though about it, then did it again. Took out several cables the second time.
Is It Just Me? v233893843