Re: [PHP] PHP/CSS/Javascript question
- Original Message - From: "tedd" <[EMAIL PROTECTED]> Yes, it's just a text file -- it can be re-written. However, it needs to be loaded again to take affect. And it affects all documents of all users. Suddenly, by the action of one user, all other users reaching the same page will see things as per the actions of another user. Unless you take care to keep separate CSS files. Yes, that's true -- but I was thinking that the user was the coder and that's what he/she wanted to do -- not that it was open to users to change per their whim. Perhaps I misunderstood the original post. Well, the original question was quite short. Either of us might be right or wrong. I assumed the case of a table with optional sub-items, like an expanding tree, or a menu or a table with categories where you want to expand any of the categories into its components. document.getElementById('IdOfDivContainingTable').style.display='none'; It is particularly usefull to enclose whichever set of elements that you wish to change into a single entity, a DIV or SPAN, if at all possible. That's the main principle of ajax, isn't it? Using DOM to apply changes within the document. It might be old-hat to most, but I find it fascinating. No, this is not AJAX, it is simply using the DOM. Ajax also involves communication with the server in the background. Yes, you are correct -- thanks for the clarification. At this point in my learning, both appear so intertwined that they are synonymous. Styles assigned in this way have precedence over those from a style sheet The precedence is simply inheritance -- last stated is applied. No, if you dynamically load a new stylesheet after you set the style of an element using the DOM, this style would still have precedence over the new stylesheet. The precedence of styles is set by how you set it. Setting a style through the DOM has precedence over CSS attributes, which have precedence over styles specified by the style HTML attribute which has precedence over the default rendering of an element. Only within the same category the order of assignment would matter. And, by the way, yes, you can load a new stylesheet. As Johnny Carson said often "I didn't know that!" -- thanks. So it's: DOM > CSS > HTML > Browser Default -- is that the precedence you are saying? That's what my manual says. I remembered there was some precedence issue from some code of mine, some time ago, that didn't work as expected. I think it was a style="" attribute that wasn't working while when assigning it via the DOM did, and I couldn't figure out until I realized that a CSS definition was in between, having higher precedence than the style attribute, but lower than the DOM. One of those bugs that drive you nuts. Satyam tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/CSS/Javascript question
Yes, it's just a text file -- it can be re-written. However, it needs to be loaded again to take affect. And it affects all documents of all users. Suddenly, by the action of one user, all other users reaching the same page will see things as per the actions of another user. Unless you take care to keep separate CSS files. Yes, that's true -- but I was thinking that the user was the coder and that's what he/she wanted to do -- not that it was open to users to change per their whim. Perhaps I misunderstood the original post. document.getElementById('IdOfDivContainingTable').style.display='none'; It is particularly usefull to enclose whichever set of elements that you wish to change into a single entity, a DIV or SPAN, if at all possible. That's the main principle of ajax, isn't it? Using DOM to apply changes within the document. It might be old-hat to most, but I find it fascinating. No, this is not AJAX, it is simply using the DOM. Ajax also involves communication with the server in the background. Yes, you are correct -- thanks for the clarification. At this point in my learning, both appear so intertwined that they are synonymous. Styles assigned in this way have precedence over those from a style sheet The precedence is simply inheritance -- last stated is applied. No, if you dynamically load a new stylesheet after you set the style of an element using the DOM, this style would still have precedence over the new stylesheet. The precedence of styles is set by how you set it. Setting a style through the DOM has precedence over CSS attributes, which have precedence over styles specified by the style HTML attribute which has precedence over the default rendering of an element. Only within the same category the order of assignment would matter. And, by the way, yes, you can load a new stylesheet. As Johnny Carson said often "I didn't know that!" -- thanks. So it's: DOM > CSS > HTML > Browser Default -- is that the precedence you are saying? tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/CSS/Javascript question
JF on March 11th answered it appropriately. Please take this topic off this group. Thanks. On 3/12/06, Satyam <[EMAIL PROTECTED]> wrote: > > - Original Message - > From: "tedd" <[EMAIL PROTECTED]> > > > >> >Hi all, > >>> > >>>Is it possible to modify a table using JavaScript to control CSS > >>>visabilty when the entire table is developed dynamically using PHP? > >>> > >>>Thanks, > >>>Paul > > > > Satyam said: > > > >>You don't need to change the CSS (I don't even know if it is possible), > >>but you can change specific styles of any element within the HTML. For > >>example: > > > > Yes, it's just a text file -- it can be re-written. However, it needs to > > be loaded again to take affect. > > And it affects all documents of all users. Suddenly, by the action of one > user, all other users reaching the same page will see things as per the > actions of another user. Unless you take care to keep separate CSS files. > > > >>document.getElementById('IdOfDivContainingTable').style.display='none'; > >> > >>It is particularly usefull to enclose whichever set of elements that you > >>wish to change into a single entity, a DIV or SPAN, if at all possible. > > > > That's the main principle of ajax, isn't it? Using DOM to apply changes > > within the document. It might be old-hat to most, but I find it > > fascinating. > > > > No, this is not AJAX, it is simply using the DOM. Ajax also involves > communication with the server in the background. > > >>Styles assigned in this way have precedence over those from a style > sheet > > > > The precedence is simply inheritance -- last stated is applied. > > No, if you dynamically load a new stylesheet after you set the style of an > element using the DOM, this style would still have precedence over the > new > stylesheet. The precedence of styles is set by how you set it. Setting a > style through the DOM has precedence over CSS attributes, which have > precedence over styles specified by the style HTML attribute which has > precedence over the default rendering of an element. Only within the > same > category the order of assignment would matter. > > And, by the way, yes, you can load a new stylesheet. > > Satyam > > > > > > > tedd > > > > -- > > > > > http://sperling.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Anas Mughal
Re: [PHP] PHP/CSS/Javascript question
- Original Message - From: "tedd" <[EMAIL PROTECTED]> >Hi all, Is it possible to modify a table using JavaScript to control CSS visabilty when the entire table is developed dynamically using PHP? Thanks, Paul Satyam said: You don't need to change the CSS (I don't even know if it is possible), but you can change specific styles of any element within the HTML. For example: Yes, it's just a text file -- it can be re-written. However, it needs to be loaded again to take affect. And it affects all documents of all users. Suddenly, by the action of one user, all other users reaching the same page will see things as per the actions of another user. Unless you take care to keep separate CSS files. document.getElementById('IdOfDivContainingTable').style.display='none'; It is particularly usefull to enclose whichever set of elements that you wish to change into a single entity, a DIV or SPAN, if at all possible. That's the main principle of ajax, isn't it? Using DOM to apply changes within the document. It might be old-hat to most, but I find it fascinating. No, this is not AJAX, it is simply using the DOM. Ajax also involves communication with the server in the background. Styles assigned in this way have precedence over those from a style sheet The precedence is simply inheritance -- last stated is applied. No, if you dynamically load a new stylesheet after you set the style of an element using the DOM, this style would still have precedence over the new stylesheet. The precedence of styles is set by how you set it. Setting a style through the DOM has precedence over CSS attributes, which have precedence over styles specified by the style HTML attribute which has precedence over the default rendering of an element. Only within the same category the order of assignment would matter. And, by the way, yes, you can load a new stylesheet. Satyam tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/CSS/Javascript question
>Hi all, Is it possible to modify a table using JavaScript to control CSS visabilty when the entire table is developed dynamically using PHP? Thanks, Paul Satyam said: You don't need to change the CSS (I don't even know if it is possible), but you can change specific styles of any element within the HTML. For example: Yes, it's just a text file -- it can be re-written. However, it needs to be loaded again to take affect. document.getElementById('IdOfDivContainingTable').style.display='none'; It is particularly usefull to enclose whichever set of elements that you wish to change into a single entity, a DIV or SPAN, if at all possible. That's the main principle of ajax, isn't it? Using DOM to apply changes within the document. It might be old-hat to most, but I find it fascinating. Styles assigned in this way have precedence over those from a style sheet The precedence is simply inheritance -- last stated is applied. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/CSS/Javascript question
>Hi all, Is it possible to modify a table using JavaScript to control CSS visabilty when the entire table is developed dynamically using PHP? Thanks, Paul You don't need to change the CSS (I don't even know if it is possible), but you can change specific styles of any element within the HTML. For example: document.getElementById('IdOfDivContainingTable').style.display='none'; It is particularly usefull to enclose whichever set of elements that you wish to change into a single entity, a DIV or SPAN, if at all possible. Styles assigned in this way have precedence over those from a style sheet Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/CSS/Javascript question
Hi all, Is it possible to modify a table using JavaScript to control CSS visabilty when the entire table is developed dynamically using PHP? Thanks, Paul Paul: I am sure that you can change css via javascript, but you can as well with php -- see: http://www.sperling.com/examples/styleswitch/ tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/CSS/Javascript question
On 3/11/06, Paul Goepfert <[EMAIL PROTECTED]> wrote: > > Hi all, > > Is it possible to modify a table using JavaScript to control CSS > visabilty when the entire table is developed dynamically using PHP? http://www.google.es/search?q=javascript+change+visibility&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficial It shows some good examples. Look the firsts results. I think PHP has nothing to do here, it just writes the table to html, but if you do a good JS function and your PHP'd html has id's, it should work fine. Thanks, > Paul > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Esú - http://esu.proyectoanonimo.com http://www.proyectoanonimo.com
[PHP] PHP/CSS/Javascript question
Hi all, Is it possible to modify a table using JavaScript to control CSS visabilty when the entire table is developed dynamically using PHP? Thanks, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php