Out of pure curiosity: Assuming tabulated data in HTML is being generated by a PHP script, would it be better to alternate each row's background color with PHP or rely on JS to do it? One is run client-side and the other server-side so my guess you have to take the whole web app as a whole and see which side should be spared the additional workload. Is it situational or is there an absolute rule? In a vacuum, I guess you could argue PHP would be better since it cannot be turned off in the way JS can (unless plugins like NoScript can block PHP as well), but I don't have enough experience with either to be sure.
I want to have <div> cells that the background-color css style dynamically change between 4 colors depending on how many times they are clicked. The options are none, yellow, red and green then repeat. So when the page loads, they are all at none, and if you click once it goes to green, twice to yellow, three times to red, then back to none.
I have a page which contains an <ul> list with 5 items. Each of those items has a data-weight attribute which corresponds to its importance in the list. I have to make only one random list item appear and use the weight to make sure that the most important one shows up more often than the least important item.
I'm working on a site where we display two lists of boats, sail or power via the organic tabs plugin. Now, our client wants us to show one list type by default depending on the class of the body tag - for example, if the user was on a sailing boat page, the body would have a class of 'sailPage' and therefore the list that would be shown by default would be the 'sail list' - and vice versa for the power (although be default this one shows first anyways as it is the first 'panel' in the HTML') In my admittedly rather clumsy way, I've written the following jQuery function which does seem to work (well, the first half) - however when the user clicks back on to the 'power' tab whilst on page with a class of 'sail', the power list doesn't display. There also seems to be a problem in IE7 where the content of the lists will not display until you select the other tab first, and then select the second tab again?
I'm trying to create a list that contains items which are filters for a search. The list shows 10 items (max) on the page load. if there are more than 10 it changes the class of the elements > 10 so they are hidden, and a 'show more' link is appended. Now if the user has 'unhidden' the previously hidden items and then chooses one, I want the class for all those previously hidden items to change until the user has deselected that item.
Is there a better, smaller way to write this? It works for what i need currently, but there are future features im planning that will not be practical checkingindividualindexes the way i've done it.
I have a form that I am using for several different pages as they are exactly the same... however at the top you must make a choice from the drop down box that then shows the appropriate fields to fill in. Can I make the drop down default to a certain option depending on which page they are coming from?
I have an oscommerce web site with a cart in the header which shows/hides the content when you hover over it. What I'm trying to do is alternate the row color of the part that drops down when items have been added to the cart but I'm just not getting it right no matter what I try.
I'm trying to get a return boolean or something I could use to then do another asynchronous request have my first has completely finished.
I think what I'm coming across is when I click the icon it updates the table but before that onreadystatechange can hit 4 my request for the new content is going through so the request url I'm using as well as the return div id for the responseText are getting mixed up between trying to do a sql update, loading the responseText in "message" then trying to sql query for the new results and loading that responseText in "content".
so I have this script that alternates my CSS stylesheets and it's working great. The thing is, there was a cookie coding that was included but it doesn't work. Basically what I want to do is that the browser remembers which stylesheet the user had chosen and keep it the same for all pages, for a determined period of time.
I have been building a menu that has a sub menu that appears below all of the main menu items. I have got this working and will include the code I used to do this below.
Now I want to change the button image so that it is visible which sub-menu the items that appear below belong to. Code:
which was very helpful and with some playing around I can now get my existing menu to complete part of my task. But I have 4 menu items and therefore need to use a "var" command to allow me to define different button images for different menus. Code:
I have my own items on a page, some based on css styles, which I would like to be compatible with the selected theme. What I would like to know is how to obtain the theme's base background color, text color, and their respective hover colors. I am aware that I could use things like ui-state-default ui-state-hover in the class but other non-color attributes like font bolding ect affect my elements. As a simple example I have a css <ul> <li> based menu which may show the default color but I am unable to deploy the hover color. I would have thought the simplest and most direct way would have been color only classes.
I've tried to two different datepicker scripts and what I'm trying todo is hilite which dates satisfy a certain condition.For example, when the page loads I will make a JSON call to the serverto return all dates that are holidays, then on the inline datepicker Iwant to hilite those cells in red.What I'm doing now is something like this in the JQuery-UI atepickerimplementation but nothing works: