WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You

WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Trailing Box Empty Trailing Box Sun Aug 22, 2010 7:09 pm

Fatal Dawn


Registered Member
Registered Member
I'm just wondering how some websites have that following welcome box for guests.
Can anyone explain the coding behind that feature?

2Trailing Box Empty Re: Trailing Box Sun Aug 22, 2010 7:10 pm

Guest


Guest
i think that can be done with Php,however forumotion doesnt support it.

3Trailing Box Empty Re: Trailing Box Sun Aug 22, 2010 7:31 pm

Joel

Joel
Registered Member
Registered Member
Welcome box? Like a popup? Could you provide screenshots or links?

http://www.advertisehotspot.info/

4Trailing Box Empty Re: Trailing Box Sun Aug 22, 2010 8:18 pm

ankillien

ankillien
Administrator
Administrator
Hey Dawn,

It can be done with CSS and/or JavaScript.
I'll explain the easy method, with CSS...

<div style="position : fixed; top : 100px; left : 100px; border : 1px solid #999; background : #FFC;">
Hello Guest!
</div>

Notice the style, position:fixed;
It makes the DIV box stay fixed on the screen at the defined position.

We define its position using top/right/bottom/left properties.
In this example we have used top:100px; and left:100px;. That means it will show up 100 px away from top and left end of the screen.

The border and background are just there to decorate the box Wink

Hope it helps Very Happy

-----------
EDIT :

Making it for guest only depends on what software you are using. The coding for it differs for different softwares.

5Trailing Box Empty Re: Trailing Box Tue Aug 24, 2010 2:27 am

Fatal Dawn


Registered Member
Registered Member
Thanks ankillien, that makes a lot of sense and I thought it had something to do with the fixed position. Wink

But two more things in addition I wanted to ask:

1. What about closing or hiding the div? Is there a way you can click the box to hide it? I tried using a javascript code that makes the visibility 0 onclick, but to no avail.

2. Can you specify a size for the box. I know it usually makes it's own size based on the amount of text inside, but can this modified.

Thanks again. Smile

6Trailing Box Empty Re: Trailing Box Tue Aug 24, 2010 8:05 am

ankillien

ankillien
Administrator
Administrator
To hide the box, you should use display:none; and apply it using javascript onclick event. I'll give you a javascript soon.

To define the size of the box you can use height and width properties that go inside the style="" attribute, like this...

<div style="position : fixed; top : 100px; left : 100px; border : 1px solid #999; background : #FFC; width : 200px; height : 300px;">
Hello Guest!
</div>

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

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