Staredit Network > Forums > Technology & Computers > Topic: Generic website-making problems
Generic website-making problems
Sep 13 2009, 9:36 pm
By: Centreri  

Sep 13 2009, 9:36 pm Centreri Post #1

Relatively ancient and inactive

Well, I'm working on my website (dammit, I need to make it. :(), and so far the general layout has some problems. I'll send the whole thing (so far) up online soon, but for now, here's my current list of problems. These are CSS and Javascript so far, as I haven't gotten around to making the PHP backbone yet.

1) I'm creating a recoloring feature that lets you recolor the whole site with the touch of a button on the top-right, with a choice of several color schemes. It uses the pixastic library for javascript-powered image recoloration, and for the rest of the website just switches between CSS files. I have it so that it changes on mouseover and changes back on mouseout, but I'm planning to make it permanent by actually clicking on the icon. For this, I need it to create a cookie, and I seem to be having problems with that. My attempts at creating javascript cookies seem to be failing. Here's what I use as the generic javascript cookie code:
Code
function setCookie(name, value, date){
    document.cookie = name + "=" + escape(value) + ";expires=" + date;
}

function getCookie(name){
    if(document.cookie.length > 0){
        startC = document.cookie.indexOf(name+"=");
        if(startC != -1){
            startC += name.length+1;
            endC = document.cookie.indexOf(";",startC);
            if (endC == -1) endC = document.cookie.length;
            return unescape(document.cookie.substring(startC,endC));
        }
    }        
    return null;
}

function delCookie(name){
    if (getCookie(name)){
        document.cookie = name + "=" + ";expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

And here's the current implementation:
Code
function setskin(x,y,z,linkz){
            setCookie('skin', x+'|'+y+'|'+z+'|'+linkz, 'Thu, 01-Jan-70 00:00:01 GMT');
        }

The function is executed onClick. I can do it directly, but I'm keeping it open if I need to add to it. Anyway, this doesn't set the cookie; nothing works, and I haven't found it with the cookie search in Chrome.

2) The recoloration library doesn't seem to work with background images, so instead I made it a full image in the banner-area DIV, made it unselectable, and am now trying to stop it from stretching the div to its full 2560 pixels. Theoretically, overflow:hidden should do it, but I haven't been able to get it to work.

3) This part should be rather simple, but... yeah. the layout is banner, two side-panels below the banner as well as a main content area (one for navigation, one for a probably shoutbox or something) and a footer below everything. My current problem is limiting it so that unless something stretches the whole thing, all of this fits on one screen and doesn't go below (so, 92px banner area, 100px footer area, and a 100% - 192 nav/main height). Otherwise, all of the three divs housing the two side panels and the main content area are stretched, and the footer is below them. Here's my current body:

Code
<body onload="loaded();">
    <div style="width: 100%; height: 92; overflow:hidden; margin: -8px;">
        <div style="height:17px; position:relative; z-index:1;">
            <div style="position:absolute; right: 100px; top: 1px;">
                <img src = "../Images/red-white.png" onMouseOver="adjusthue(120,0,0,'../Libraries/red.css')" onMouseOut="readjusthue(-120,0,0,'../Libraries/purp.css')" onClick="setskin(120,0,0,'../Libraries/red.css')" />
                <img src = "../Images/green-white.png" onMouseOver="adjusthue(-140,0,-20,'../Libraries/green.css')" onMouseOut="readjusthue(140,0,20,'../Libraries/purp.css')" onClick="setskin(-140,0,-20,'../Libraries/green.css')" />
            </div>
        </div>
        <img src="../Images/Banner.png" class = "unselectable" style="position:absolute; z-index:0;" id="banner" />
        <div style="width:400px; height:70; margin: 0 auto; position:relative; clear:both; z-index:1;">
            <img src="../Images/Banner-Text.png" class="unselectable" style="position:relative; margin: 3px;" id="bantext" />
        </div>
    </div>
    <div style="top:92px; width: 200px; height: 100%; position:absolute; margin-left:-8; margin-bottom:100px;" class="nav">
        Navigation
    </div>
    <div style="top:92px; position:absolute; left: 200px; margin-bottom: 100px">
        blah blah content
    </div>
    <div style="top:92px; position:absolute; width: 200px; right:0px; height:100%;margin-bottom: 100px;" class="extra">Shoutbox and stuff.</div>
    <div style="position:absolute; left: 0px; width: 100%; height: 100px; bottom:0px;" class = "footer">Footer and stuff.</div>
 </body>

Again, I'll bring it online in a few hours. Well, I'll try. Not sure if my hosting still works, actually.

Thanks in advance.



None.

Sep 15 2009, 12:09 pm Forsaken Archer Post #2



1) It's because your cookie is expiring:
document.cookie = name + "=" + ";expires=Thu, 01-Jan-70 00:00:01 GMT";
2) Make it a background instead of an image? I don't understand what you are trying to do here.
3) Layout tweaks and/or use min/max-height. Can't be assed to load your code.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
[2024-5-16. : 5:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
Please log in to shout.


Members Online: 5harperc441eh1, 8oliviae241ye2, Roy