Jump to content

V for Vincent

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by V for Vincent

  1. Hey, someone asked me to make a small website that looks like an old tv-set where you can switch pages by using the tv's buttons. Okay, I figured I'd tackle this using javascript for the buttons and dhtml to change the contents of the "screen". Now, I felt that just the buttons didn't really provide a clear interface, so I figured would use dhtml so that, when you hover over one of the buttons, an image appears that says what that button is for. Strange thing is, I simply cannot get the image to remain static as long as I want it to disappear when the user stops hovering over the button. Onmouseover and onmouseout events simply follow eachother as fast as they can, both in IE and in FF. Here's the relevant code:HTML:<div id="button1" onmouseover="textbubble1('325px', '479px','textbubble','button1.gif')" onmouseout="antitextbubble()"></div>JS:function textbubble1(margelinks, margetop, layer, imageUrl){document.getElementById('textbubble').style.display="block";document.getElementById('textbubble').style.left=margelinks;document.getElementById('textbubble').style.top=margetop;setBackgroundImage(layer,imageUrl);}function antitextbubble(){document.getElementById('textbubble').style.display="none";}function setBackgroundImage( layer, imageUrl ) { if( document.getElementById ) { return document.getElementById( layer ).style.backgroundImage = "url("+imageUrl+")"; } else if( document.all ) { return document.all[layer].style.backgroundImage = "url("+imageUrl+")"; } else { return document[layer].background.src = imageUrl; }}CSS:#textbubble {position: absolute;min-width: 420px;width: 420px;min-height: 300px;height: 300px;Z-index: 2;left: 325px;top: 481px;display: none;}#button1 {position: absolute;min-width: 30px;top: 535px;min-height: 30px;width: 30px;height: 30px;left: 260px;Z-index: 1;}I'm aware there may be some redundancy, as I'm still new to this whole business, but I don't think that's causing the issue. ######, I recently made another website with similar mouseover background changes and those work fine. I really can't pinpoint the difference, so I would be very much obliged if someone else could.

  2. Hey there,I've nearly finished my first dynamic website, but there's a small, seemingly stupid problem I can't seem to fix. The site is structured using divs with absolute positioning, but one of these has a variable height. So, in order not to mess up my lay-out (there's a logo underneath the div with variable height), I need to dynamically reposition another div. Here's my code:browser = navigator.appNameif (browser == "Microsoft Internet Explorer"){nieuwsHeight = nieuwscontainer.offsetHeight;}else {docObj = document.getElementById("nieuwscontainer");nieuwsHeight = document.defaultView.getComputedStyle(docObj, "").getPropertyValue("height");}samalandertop = nieuwsHeight+140document.getElementById("extradiv2").style.top=samalandertopdocument.write(samalandertop)Note that nieuwscontainer is the one with variable height and extradiv2 is the one that needs repositioning. Never mind the funky names. I added the final document.write to track down the problem, and it seems that height is considered a text string in FireFox. Can it be treated as a numerical variable?

  3. Hey there.I've been studying HTML, CSS and JS for a few weeks now because our student council needed a new webmaster and I'm the only one who could read some code. I've been given access to the website by the old webmaster. First thing I figured I should do was replace some massive headers by something simpler (I don't intend to rewrite the whole website, people are used to the old one). The previous webmaster didn't use CSS and had copy-pasted quite a bit of JS code in every header. I just copied the JS code, as well as part of the markup (I intend to get it all done, but that's beside the point...) to an external file and for some reason the website won't open in IE. I've put some of the necessary files on the free webspace my provider, well, provides, but the servers don't allow PHP, so you'll have to download the documents found here:My WebspaceThe images don't work. I know. They're just not necessary to solve the problem. If you compare presidium6.php and presidium7.php's headers, I'm sure you'll notice the difference.Anyone out there have a clue? I know it's a pretty boring thing to ask, but I'm really stuck ATM.

×
×
  • Create New...