PDA

View Full Version : Contractible Headers alignment



neo_philiac
07-10-2006, 03:52 PM
1) Script Title: Contractible Headers

2) Script URL (on DD):

<p class="style2" onClick="expandcontent('sc1')" style="cursor:hand; cursor:pointer">What is JavaScript?</p>
<p class="style2">

<div id="sc1" class="style2; switchcontent">
JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
</div>

3) Describe problem: This thing works fine but what do need to do to change the alignment of the explanation. Example:
The way I have it, is like this:

What is java:
Java is bla bla bla......

I want it to look like :

What is java:
Java is bla bla bla......

I can put space but is there any css styly i can write for this? I tried putting padding but my whole document content shifts to right.

Please help!!

jscheuer1
07-11-2006, 07:20 AM
1) Script Title: Contractible Headers

2) Script URL (on DD):


Please supply a link to the script.



The way I have it, is like this:

What is java:
Java is bla bla bla......

I want it to look like :

What is java:
Java is bla bla bla......

What's the difference? Style can be applied to any element or class of elements and there are many style property/value pairs to choose from. The trick is to select one(s) appropriate to the effect you want to achieve and applying them to only those elements that you wish to have them apply to.

neo_philiac
07-11-2006, 04:38 PM
Sorry he he....

The way I have it, is like this:

What is java:
Java is bla bla bla......

I want it to look like :

What is java:
Java is bla bla bla......

The problem is i cant apply any margin or padding to that particular text

neo_philiac
07-11-2006, 04:39 PM
there are line 5 spaces before the Java is bla bla bla......

jscheuer1
07-12-2006, 04:29 AM
margin-left:2em;

should work. 5em would technically be 5 characters but, often times it works out to look like more than 1 character per em. This should only be applied to element(s) that you want to have this offset and the width of these elements must either be auto, not set, or less than their parent element to avoid shifting of the entire page. Other style interdependencies could come into play, if you continue to have problems:

Please post a link to the page on your site that contains the problematic script so we can check it out.

Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

neo_philiac
07-12-2006, 01:32 PM
ok now i have a new problem. when I view the page, the header is header by default is expanded. i have to click on twice to get it back to its unexpanded state.

here is what i did with the class . body 2 is the class with left margin attribute.

<h3 onClick="expandcontent('sc3')" style="cursor:hand; cursor:pointer">What is DHTML?</h3>

<div id="sc3" class="switchcontent; body2">
DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.
</div>

sorry this is stupid, i know but please help because i need to get it done.

jscheuer1
07-12-2006, 04:18 PM
If you continue to have problems:

Please post a link to the page on your site that contains the problematic script so we can check it out.

Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

jr_yeo
07-12-2006, 05:18 PM
here's the missing DD script URL :
http://www.dynamicdrive.com/dynamicindex1/navigate2.htm :p

jscheuer1
07-12-2006, 05:32 PM
here's the missing DD script URL :
http://www.dynamicdrive.com/dynamicindex1/navigate2.htm :p

jr. - Do you have a link to the OP's page as well? :rolleyes:

jr_yeo
07-12-2006, 05:54 PM
what's OP? :p

whatever it is... the answer is no :D

jscheuer1
07-12-2006, 08:29 PM
what's OP? :p

whatever it is... the answer is no :D

Original Poster. It avoids having to look back to see the username or having to use the awkward he/she him/her stuff or just plain getting the OP's gender wrong.

I think we need to see that entire page, how it is laid out, to really get anywhere with this. The full code enclosed in
code goes here tags would do if the OP hasn't got a link.

jr_yeo
07-13-2006, 05:13 AM
I think we need to see that entire page, how it is laid out, to really get anywhere with this.
i know so what ur saying man :D but the OP still ddnt provide me, as well, a link to his problemtic page :D

but neo_philiac (which is the OP here, i think) is just a newbie who is having anxiety attacks :D

<EDIT>

but would it help u if posted the whole Contractible Headers script here?

jscheuer1
07-13-2006, 05:24 AM
i know so what ur saying man :D but the OP still ddnt provide me, as well, a link to his problemtic page :D

but neo_philiac (which is the OP here, i think) is just a newbie who is having anxiety attacks :D

<EDIT>

but would it help u if posted the whole Contractible Headers script here?

Anxiety attacks, I like that one. You should be a therapist. I don't think it much matters what the original script is, I can always see the link you provided and that I would have hoped neo would have provided the first time I asked for it. Maybe neo's after the white rabbit, who knows? Even if it is not required (though it might be crucial), it certainly would make our job much easier to see the code neo has so far. This is free help after all.

jr_yeo
07-13-2006, 05:33 AM
You should be a therapist.
he he :D jack of all trades master of none :P

neo_philiac
07-14-2006, 01:24 PM
You guys have too much time in your hand. Get a life. There was no need for providing the whole script. If you “geniuses” had just told me to set “var collapseprevious = yes” and also in the script provided (<div id="sc3" class="switchcontent; body2">) I shouldn’t put “;” it would have solved all my problems. Thanks for nothing.

Just answering questions here dosent make you an expert. People come here for help not to listen to your smart ass remarks.

jscheuer1
07-14-2006, 01:38 PM
You guys have too much time in your hand. Get a life. There was no need for providing the whole script. If you “geniuses” had just told me to set “var collapseprevious = yes” and also in the script provided (<div id="sc3" class="switchcontent; body2">) I shouldn’t put “;” it would have solved all my problems. Thanks for nothing.

Just answering questions here dosent make you an expert. People come here for help not to listen to your smart ass remarks.

This is the first I heard you didn't have collapseprevious set to yes. Have a nice day.