PDA

View Full Version : Coding in expandables



Soy
27-09-2008, 07:00 PM
Iv'e looked online,

Iv'e learnt html css and a bit of javascript but I still am not sure how you code in expandables, any links to tutorials would be useful

Jxhn
27-09-2008, 07:47 PM
Expandable whats?
Divs or iframes? Exandable iframes require javascript (most people get of dynamic drive) and expandable divs require that you don't use fixed size images.

Soy
27-09-2008, 07:53 PM
expandable divs sorry

--ss--
27-09-2008, 07:54 PM
http://www.habboxforum.com/showthread.php?t=453923 :eusa_whis

Jxhn
27-09-2008, 07:58 PM
http://www.habboxforum.com/showthread.php?t=453923 :eusa_whis

Yeah, but you only really need to make images of the corners and use borders and background-color for the rest in the example of yours.

L?KE
27-09-2008, 10:02 PM
You can't use a border to create the edges of what he's done.

That tutorial is good and with a bit of common sense and logic you can built that into a more complex layout.

Jxhn
02-10-2008, 06:25 PM
You can't use a border to create the edges of what he's done.

You can.

<style>
div.border
{
background-image: url(leftcorner.jpg);
}
div.border div
{
border-width: 1px 0px 0px 0px;
background-color: #000000;
}
div.border div div
{
background-image: url(rightcorner.jpg);
}
</style>
<div class="border"><div><div></div></div></div>

Meti
03-10-2008, 07:08 PM
http://www.habboxforum.com/showthread.php?t=515762:eusa_whis

--ss--
03-10-2008, 07:13 PM
You can.

<style>
div.border
{
background-image: url(leftcorner.jpg);
}
div.border div
{
border-width: 1px 0px 0px 0px;
background-color: #000000;
}
div.border div div
{
background-image: url(rightcorner.jpg);
}
</style>
<div class="border"><div><div></div></div></div>
That's just complicating things and making it messy.
The example is for a general box, sure you could do it your way with corners but not going to be much use when it comes to more complicated boxes.

Jxhn
03-10-2008, 08:48 PM
That's just complicating things and making it messy.
The example is for a general box, sure you could do it your way with corners but not going to be much use when it comes to more complicated boxes.

It means it can extend both ways rather than just one and should reduce load times.

--ss--
03-10-2008, 08:52 PM
It means it can extend both ways rather than just one and should reduce load times.
Not many boxes actually need to expand Horizontally though ;).

Cushioned
04-10-2008, 06:34 AM
The way that I have learned, is either:
A) Don't put a height to it, then it expands to the text amount
OR
B)Use background-repeat: repeat-y; in the CSS
Example:


#boxmid {
background-image: url(boxmid.PNG);
background-repeat: repeat-y;
width: 123px;
padding-left: 3px;
}


Not sure if this is totally right, but yeah :P

Meti
04-10-2008, 09:04 AM
You don't have to add the background-repeat: repeat-y;

it works without it.
it does for me

Cushioned
04-10-2008, 05:13 PM
You don't have to add the background-repeat: repeat-y;

it works without it.
it does for me

Yeah. It's just if you want it to expand a certain amount, that will make it stay at the amount you want :)

Want to hide these adverts? Register an account for free!