Some sites have example code which is not completely viewable within the text field. But once there is an onClick or hover the code stretches out of the field or text box to show it all or allow it to be selected and copied. This effect does not move any of the existing layout. As if the reveal was on a different z-index.

ralphm
—
2012-04-13T14:01:56Z —
#2

That sounds very much like JavaScript. Do you have an example?

SunnaH
—
2012-04-13T14:49:38Z —
#3

I wish I did or I probably would not have to ask I have seen it on a few CSS blogs so I am hoping I stumble on one again.

RyanReese
—
2012-04-13T16:54:11Z —
#4

SunnaH said:

Some sites have example code which is not completely viewable within the text field. But once there is an onClick or hover the code stretches out of the field or text box to show it all or allow it to be selected and copied. This effect does not move any of the existing layout. As if the reveal was on a different z-index.

Well without some sort of site to reference this with, I'd say it would be done in Javascript.

Is the stretching htat appears, is that instant or does the stretching occur over some short period?

You can have disabled="true" (I think that's how you write it) on <input>'s or textareas to avoid people from typing/editing it in, although I do believe you'd need Javascript to switch that setting.

So either way I do think there is probably at LEAST a little bit of Javascript going on :).

dresden_phoenix
—
2012-04-13T17:14:42Z —
#5

W/o seeing the code that could be done any number of ways, with j/s or even CSS3.

I am thinking, since this is the CSS forum, that it could be a combination of OVERFLOW:hidden; , explicit height, CSS transition with a applied for that smooth effect.

Is there a method to have a slider between two divs set at 50 % floated side by side that reveals the content of the left div by expanding to 80% on mouse over and the right div decreases to 20 %. Then the mouse over to the right div will increase it to 100% while decreasing the left div to 20%. Of course the transition between the two is at the same time should be gradual not an immediate click instance change.

DaveMaxwell
—
2012-05-01T12:44:41Z —
#8

The easiest way to do it is just to set an inside margin on each div. Then on hover, set a minimum-width to 80%. This should get you the behavior you desire.

SunnaH
—
2012-05-01T12:57:31Z —
#9

Thank you. Do you mind providing example code? I am a bit new and a visual example works better for me.

SunnaH
—
2012-05-01T13:33:58Z —
#10

I hope I was explaining myself correctly in the beginning. Basically I am looking for the onMouseOUt for teh left and right divs to go back to its original width such as 50%. So the onMouseOver on either the left or right div will expand it to 80% while the right side decreasing to 20% This would work the same if for the other side too. When the user mouses over the right side which is currently at 20% the right div would expand to 800% and the left div will be at 20%. This transition happens simultaneously and is smooth. I was told the CSS3 property of transition would do something like this. AND I am only coding for IE 9+, Safari, Chrome, Firefox.

Yes it does for the left. I could not get it to behave the same way for the right. And instead of the z-index the left layer should push the opposite side on the same z level.

PaulOB
—
2012-05-01T16:25:16Z —
#14

You lost me there lol

You originally said you wanted the textbox to expand but not to influence the layout so it just slides over the top - which is what my example does.

I'm not sure what you are after now but the w3c link you pointed to is no different in essence from the effect in my example.

If you want content on the right to move out of the way then just remove the fixed widths from the parent.

SunnaH
—
2012-05-01T16:30:07Z —
#15

I am very sorry Paul. I have been trying to make the code work the way I want but I am not getting. I also am trying to follow this examplehttp://jsfiddle.net/yCY9y/3/ but it is not firing. I think this effect can be achieved with ease-in-out. So no JavaScript

The yellow part is floated, the red is not. By default, the red has no width, and due to the nature of what is happening, the red will take up the available width left. When Paul uses the CSS3 to expand the width, the red box (because there is less width available now), has to get smaller.

SunnaH
—
2012-05-02T11:59:28Z —
#19

Been trying unsuccessfully yesterday. I was adding additional styles using a different class name for the right side thinking it would behave the same.