change background image and save

View previous topic View next topic Go down

avatar
grimofdoom
Member
Member
Forum Posts : 106
Member Since : 2012-03-06
View user profile

Postgrimofdoom on 14/4/2012, 8:22 pm

I need a script that changes background image and save. though click the background pic preview to change/save.
avatar
LGforum
Moderator
Forum Posts : 77
Member Since : 2011-11-12
View user profile

PostLGforum on 15/4/2012, 9:07 am

You can save things for users using cookies. Presumably your wanting to allow users to change the background?
avatar
grimofdoom
Member
Member
Forum Posts : 106
Member Since : 2012-03-06
View user profile

Postgrimofdoom on 15/4/2012, 10:01 am

yes.and i have 0% of javascript knowledge so i dont know how
avatar
LGforum
Moderator
Forum Posts : 77
Member Since : 2011-11-12
View user profile

PostLGforum on 15/4/2012, 3:00 pm

Two good cookie function:

Code:

function getcookie(name) {
    cname = name + '=';
    cpos = document.cookie.indexOf(cname);
    if (cpos != -1) {
        cstart = cpos + cname.length;
        cend = document.cookie.indexOf(';',cstart);
        return unescape(document.cookie.substring(cstart,cend));
    }
    else {return null;}
}

function setcookie(name,value,sticky) {
    expires = '';
    if (sticky) {expires = ' expires=Wed, 1 Jan 2020 00:00:00 GMT;';}
    document.cookie = name + "=" + value + '; path=/;' + expires;
}

You'll need to design the system how you want your users to change the background image.
- dropdown list?
- Button?
- Upload there own image?
etc...
avatar
grimofdoom
Member
Member
Forum Posts : 106
Member Since : 2012-03-06
View user profile

Postgrimofdoom on 15/4/2012, 3:20 pm

im thinking button(button is preview of pic),like the one in the tutorial on here but on click instead of onmouseover and save it.
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum