Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mik3847

    Help with Arrays and Loops

    Thanks for all your help jsuji, your a legend! Mike
  2. mik3847

    Help with Arrays and Loops

    also added: document.cookie = intY + n; *sorry can't edit post
  3. mik3847

    Help with Arrays and Loops

    I trying to do: // Create cookie to store scrolled position function scrollPos() { for ( var i=0; i<divIds.length; i++ ) { divId = divIds[i]; var strCook = document.cookie; if(strCook !=0) { var strPos = strCook.substring(+2); document.getElementById(divId).scrollTop = strPos; }...
  4. mik3847

    Help with Arrays and Loops

    I understand what you mean, but don't understand js enough to be able to do this ... /me googles for a good js book
  5. mik3847

    Help with Arrays and Loops

    ok, so I think I need to get the cookie value from the previous state and add the other values to the cookie. Then be able to read back the two values independently, is this the right way to go about this or would it be better to use separate cookies for each value? /me is lost
  6. mik3847

    Help with Arrays and Loops

    Trying to get cookie values stored for each divId using: function scrollPos() { for ( var i=0; i<divIds.length; i++ ) { divId = divIds[i]; var strCook = document.cookie; if(strCook.indexOf("!~")!=0) { var intS = strCook.indexOf("!~"); var intE = strCook.indexOf("~!"); var strPos =...
  7. mik3847

    Help with Arrays and Loops

    I see, I had tried to incorporate the onResize event into the original loop with no sucess, I think that I have a better understanding of how for loops can be used. Thanks alot
  8. mik3847

    Help with Arrays and Loops

    lol thanks :) Any chance of a bit of help with the onResize event?
  9. mik3847

    Help with Arrays and Loops

    Does the method you use have advantages?
  10. mik3847

    Help with Arrays and Loops

    I find this line rather complex in terms of what it does: var n=(/\d$/.test(divId))?divId.substr(divId.length-1):""; I would like to say I understand how that works, but it's a bit beyond me, I can see how it's taking the divId.length - 1 and creating a variable 'n', but I do not get the...
  11. mik3847

    Help with Arrays and Loops

    Thanks tsuji, that has fixed the scrolling problem. Any idea how to fix the other issues? I don't understand why one scrollbar-padder div resizes and the other does not...? I guess it may have something to do with how getElementById works.
  12. mik3847

    Help with Arrays and Loops

    I have built a test page so you can see the problems: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style> html { overflow:hidden; height:100%} body{ width:100%; font:12px arial; margin:0px...
  13. mik3847

    Help with Arrays and Loops

    Ok let me clarify: The onLoad event now works for both divs. The onResize event works for the second div but not the first. The setDivPosition function now sets both divs to the value of the second on refresh. The scrollUp / scrollDown functions only work for the second div. The div...
  14. mik3847

    Help with Arrays and Loops

    Alas, this does not work... only one div resizes. I took my attempt at the loop out to save myself some embarrassment :) Thanks for having a look btw
  15. mik3847

    Help with Arrays and Loops

    I have a script which resizes a div depending on the viewport size, allows the div to scroll using a custom scrollbar with up / down buttons and writes to a cookie to remember it's scrolled position on refresh. I have grasped the concept of arrays and how they could be used to loop through...

Part and Inventory Search

Back
Top