I'm working on a website for a client and we've decided to use CSS3 instead of Flash for multiple reasons, compatibility with mobile devices being the main. However, there's a lot of animation on the page such as fading, positioning and opening/closing and it seems to be tripping over itself attempting to process everything.
I've created an animation class that schedules all of the animations so that there's only one setTimeout running for those animations at any given time. I've also set it up so that any web browser capable of CSS3 transitions use those instead of the JS animations. The animations lag in both CSS3 and JS functionality, although the CSS3 is slightly better.Some animations lag even if they're the only animation running. For instance, trying to fade a full-screen image in/out chugs even on test pages I've created only containing the one function.
I understand that Flash uses hardware acceleration and has optimized rendering, and the reason the browser is lagging is most likely because it's all being processed unoptimized and through the CPU. However, I'm sure there must be a way to make this site smoother than it is.I'm posting here because my deadline is coming hard and fast, to ask for assistance with:Tips on how to optimize my code to run smoother in JS and/or CSS3.how to be able to fade large images/areas with less lag.I've been trying to move most of my code into OOP as I've gone along, but some functions are still a bit "spaghetti" due to my time crunch.
my webstie allows users to change the color of the background, so to keep the text readable I have it changing as well.the color picker I am using has text boxes with rgb values 0-255 for each.I am trying to get one bit of text to alternate between red and blue with the conditions
I am reading the ECMAScript specs trying to figure out if the next line is a legal statement or not new Foo();
I think the above code may only be legal as an expression and not as a stand alone statement. Would this make the above a bug?
Douglas Crockford's JSLint will choke on the above line of code and stop parsing. All the browsers seem to accept it as ok and work as I expect: the returned object just doesn't get assigned to anything.
The time I have used a line like the above is when the constructor has side effects and the "class" keeps track of all its instances.
I have several text fields on page that I would like to make calculations based on if there is a number input in one of the fields. So, if the price field is populated, the sale price field would populate using a function to do the calculation.
Now, how do I write the code for this to occur? I know how to get the function to fire based on clicking a submit button, but not sure how to do it simply based on a number keyed into the one field. Is this possible and if so, how?
I have a two fold question:1) Why would my while statement not be workingI have cleaned up my code a little (although not perfect) but my while statement is not behaving, it does not output any numbers on a console.debug (using google chrome, or any other browser for that matter) which from my understanding it should?and 2) Slightly out of the remit of this forum I suppose, but this code is quite lengthy and I know there are ways to make this more efficient I just dont know what they are?
function generatePurchaseFields(dom) { new Ajax.Request('/control/?page=tldmaxyears&domain=' + dom, { method: 'get',
This is my first time using the switch statement. I would appreciate your suggestion on how to do this properly. I am trying to get customer age which is (age) and compare it with the monthly rate then the text msg will display in the textarea. Also, I am having trouble figuring out how I can defined my monthlyRate in the switch or do I need to this outside of the switch? Code: }
I am trying to test the id of three input boxes so that I can capitalize the first letter.
The fname and lname work fine but mi does nothing and I get no error is this because of the if statement or the fact that the mi only has one character?
I need to give two separate alerts depending on what the user clicks when they click the "Submit" button. I am using a confirm box. If they click "OK" it thanks them for their order. If they click "Cancel" it should go back to the form. I have written the code that I thought would work but it will not.
function confMsg(){ var s s = confirm("Click OK to Submit Order. Click Cancel to Cancel") if (s=="true"){ alert("Thank You for Your Order!") else return; }}