Results 1 to 6 of 6

Thread: DIV tags moves to right when select all button selected

  1. #1
    Join Date
    Mar 2007
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DIV tags moves to right when select all button selected

    Hi

    Ihave no idea why this is happening. I have a check box beside each song and a button that if clicked on select all the songs checkboxes and if click again it de-selects the checkboxes. Everything works fine except when click on select all button it moves the whole div on right side to the left. I have two columns left and right, left one has a width of 188px and is a menu, whereas right column is the main content. Now the right column shifts to the end of left column height and when you de select the button it comes back to its place. I don;t know what needs to be changed to make sure it doesnt shift places when click on select/deslect all button.

    Code:
    /*code for select all de select all*/
    var checkflag = "false";
    function check(field) {
    if (checkflag == "false") {
      for (i = 0; i < field.length; i++) {
      field[i].checked = true;}
      checkflag = "true";
      return "UnSelect All"; }
    else {
      for (i = 0; i < field.length; i++) {
      field[i].checked = false; }
      checkflag = "false";
      return "Select All"; }
    }
    Thanks for any help
    Last edited by shyne; 06-28-2007 at 10:55 PM.

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Something similar happened to me when I had two div's with the same ID. And after looking at your source code, it seems that you have a similar problem. The div is being edited by your function. Easy to fix. Try giving the div a new id.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Mar 2007
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    Thanks for the reply. So do you mean I should change the name for the right column to something different? I ll try that and let you kno but by the way I am using class and not id does that still effect?

  4. #4
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Quote Originally Posted by shyne View Post
    I ll try that and let you kno but by the way I am using class and not id does that still effect?
    Yeah, it may not have any effect (still worth trying though). If you have firefox and firebug, you can use those tools to check for errors as well (I would if I had them where I am now; I feel weird not having PHP designer and Firefox). There are a bunch of things to check for. I would give everything a border and poke around the page for a while if the ID doesn't help.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  5. #5
    Join Date
    Mar 2007
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It didn't work. I tried changin the name to rightcloumn570 and instead of class I used ID and still same shifts happening. Can you may be tell me a change to script function for select/de select all. Since when I remove that its fine so I am guessing it hasto do with the fucntion messing with the column somehow.

  6. #6
    Join Date
    Mar 2007
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I changed the function it works now. Thanks alot

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •