View Full Version : Need HTML/CSS HELP!!
Cutter
26-06-2009, 09:09 PM
Hi, i'm making a layout for my up coming site but i can't get something right on it.
i'm trying to make a maraquee news box, but it keeps going wrong :(
This Is What It Should Be:
Preview: http://habbo-files.freehostia.com/should/index.html
This Is What It's Coming Out As:
Preview: http://habbo-files.freehostia.com/
HELP ME PLEASE!!!
Chippiewill
26-06-2009, 09:12 PM
Edit: Bah, didn't look at source at first :P:
Can you do?:
#news_bg #news {
padding: 0px;
with the double #?
Edit2: I suspect that's what ='s wrong
Cutter
26-06-2009, 09:23 PM
Edit: Bah, didn't look at source at first :P:
Can you do?:
#news_bg #news {
padding: 0px;
with the double #?
Edit2: I suspect that's what ='s wrong
what should i change the 0px; to?
Chippiewill
26-06-2009, 09:34 PM
hmm, if you add padding it starts appearing...
Cutter
26-06-2009, 09:38 PM
i put the padding the same as the height (25px;) but it turned into this
http://habbo-files.freehostia.com/should/index.html
Chippiewill
26-06-2009, 09:41 PM
Oh you plonker, marquee isn't XHTML, remove it and it works.. xD You can use JS instead to get the same effect...
Yonder
26-06-2009, 09:43 PM
Ye dont use marquees they are poop and old web :P
Chippiewill
26-06-2009, 09:44 PM
JS marquee: http://www.howtocreate.co.uk/jslibs/htmlhigh/simplemarquee.html
Btw, the Web Dev toolbar is really useful, use it!
Edit: I think if you use html ignore and use a JS start html thingy then you can trick it into working...
Cutter
26-06-2009, 09:57 PM
JS marquee: http://www.howtocreate.co.uk/jslibs/htmlhigh/simplemarquee.html
Btw, the Web Dev toolbar is really useful, use it!
Edit: I think if you use html ignore and use a JS start html thingy then you can trick it into working...
iv now got
<p> </p>
<div id="news_bg">
<div id="news"><script src="maraquee.js" type="text/javascript"></script></div>
</div>
</div>
<p> </p>
and in the .js file i have
<div class="dmarquee"><div>Welcome</div></div>
now it comes up like http://habbo-files.freehostia.com/should/index.html
i'n usless at coding, lol XD
Chippiewill
26-06-2009, 10:15 PM
-.-
Put:
<script src="PATH TO SCRIPT/simplemarquee.js" type="text/javascript"></script>
Between the header tags, not where you want it to show up....
Put:
<div class="dmarquee"><div><div>Marquee text</div></div></div>
Where you want the marquee
And fill the js file with:
var oMarquees = [], oMrunning,
oMInterv = 20, //interval between increments
oMStep = 1, //number of pixels to move between increments
oStopMAfter = 30, //how many seconds should marquees run (0 for no limit)
oResetMWhenStop = false, //set to true to allow linewrapping when stopping
oMDirection = 'left'; //'left' for LTR text, 'right' for RTL text
/*** Do not edit anything after here ***/
function doMStop() {
clearInterval(oMrunning);
for( var i = 0; i < oMarquees.length; i++ ) {
oDiv = oMarquees[i];
oDiv.mchild.style[oMDirection] = '0px';
if( oResetMWhenStop ) {
oDiv.mchild.style.cssText = oDiv.mchild.style.cssText.replace(/;white-space:nowrap;/g,'');
oDiv.mchild.style.whiteSpace = '';
oDiv.style.height = '';
oDiv.style.overflow = '';
oDiv.style.position = '';
oDiv.mchild.style.position = '';
oDiv.mchild.style.top = '';
}
}
oMarquees = [];
}
function doDMarquee() {
if( oMarquees.length || !document.getElementsByTagName ) { return; }
var oDivs = document.getElementsByTagName('div');
for( var i = 0, oDiv; i < oDivs.length; i++ ) {
oDiv = oDivs[i];
if( oDiv.className && oDiv.className.match(/\bdmarquee\b/) ) {
if( !( oDiv = oDiv.getElementsByTagName('div')[0] ) ) { continue; }
if( !( oDiv.mchild = oDiv.getElementsByTagName('div')[0] ) ) { continue; }
oDiv.mchild.style.cssText += ';white-space:nowrap;';
oDiv.mchild.style.whiteSpace = 'nowrap';
oDiv.style.height = oDiv.offsetHeight + 'px';
oDiv.style.overflow = 'hidden';
oDiv.style.position = 'relative';
oDiv.mchild.style.position = 'absolute';
oDiv.mchild.style.top = '0px';
oDiv.mchild.style[oMDirection] = oDiv.offsetWidth + 'px';
oMarquees[oMarquees.length] = oDiv;
i += 2;
}
}
oMrunning = setInterval('aniMarquee()',oMInterv);
if( oStopMAfter ) { setTimeout('doMStop()',oStopMAfter*1000); }
}
function aniMarquee() {
var oDiv, oPos;
for( var i = 0; i < oMarquees.length; i++ ) {
oDiv = oMarquees[i].mchild;
oPos = parseInt(oDiv.style[oMDirection]);
if( oPos <= -1 * oDiv.offsetWidth ) {
oDiv.style[oMDirection] = oMarquees[i].offsetWidth + 'px';
} else {
oDiv.style[oMDirection] = ( oPos - oMStep ) + 'px';
}
}
}
if( window.addEventListener ) {
window.addEventListener('load',doDMarquee,false);
} else if( document.addEventListener ) {
document.addEventListener('load',doDMarquee,false) ;
} else if( window.attachEvent ) {
window.attachEvent('onload',doDMarquee);
}
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2026 vBulletin Solutions Inc. All rights reserved.