Results 1 to 3 of 3

Thread: iPhone Type Wheel Woes

  1. #1
    Join Date
    Feb 2013
    Posts
    58
    Thanks
    10
    Thanked 1 Time in 1 Post

    Default iPhone Type Wheel Woes

    I have an iPhone type wheel for picking options. When I have no headings the wheel works well. However; when I add a header to the options, the wheel selection bar fails to line up on the option and the incorrect option is selected, it seems to start at one off, then two. Here is the page....

    http://www.menuhead.com/example.php

    This is the part of the javascript that I've been playing with.

    Code:
    if (data.target[0].options.length > 0) {
    				var header=""  // HERE
    				for(var i=0;i<data.target[0].options.length;i++) {
    
    					var option = data.target[0].options[i];
    					if($(data.target[0].options[i]).closest('optgroup').attr('label') && header!=$(data.target[0].options[i]).closest('optgroup').attr('label')){
    					//if(header!=$(data.target[0].options[i]).closest('optgroup').attr('label')){ // HERE
    						
    						$('<li/>', {id: ulId+'_', value: "", text: $(data.target[0].options[i]).closest('optgroup').attr('label')}).appendTo('#'+ulId); // HERE
    						header=$(data.target[0].options[i]).closest('optgroup').attr('label'); // HERE
    $('#'+ulId+'_').css({'line-height': '37px'});
    //$('#'+ulId+'_'+option.value).css({'line-height': '37px'});
    						
    						//$('#'+ulId+'_'+option.value).css({'line-height': '37px'});
    						//header=$(data.target[0].options[i]).closest('optgroup').attr('label'); // HERE
    					} // HERE
    
    					$('<li/>', {id: ulId+'_'+option.value, value: option.value, text: option.text}).appendTo('#'+ulId);
    					$('#'+ulId+'_'+option.value).css({
    						'height': '37px',
    						'line-height': '37px',
    						'text-align': 'center',
    						'display': 'block',
    						'padding': '0px',
    						'margin': '0px'
    					});
    				}

  2. #2
    Join Date
    Feb 2013
    Posts
    58
    Thanks
    10
    Thanked 1 Time in 1 Post

    Default

    Problem Solved. How do you close a thread?

  3. #3
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,729
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    We can close it, but it would be better if you could post your solution so that others with a similar problem can see how you solved it. You can also edit the first post and then select "Go Advanced" and mark the post as resolved so that others know that you were able to find a satisfactory answer.
    To choose the lesser of two evils is still to choose evil. My personal site

Similar Threads

  1. Magnetic Scroll Mouse Wheel
    By davelf in forum Looking for such a script or service
    Replies: 3
    Last Post: 02-09-2013, 07:34 AM
  2. Replies: 2
    Last Post: 01-11-2012, 06:59 PM
  3. Resolved using the mouse wheel in Opera
    By james438 in forum JavaScript
    Replies: 9
    Last Post: 09-01-2011, 03:21 PM
  4. Scroll Wheel
    By hosdank in forum Flash
    Replies: 5
    Last Post: 09-06-2008, 07:32 PM
  5. JavaScript Mouse Wheel coding
    By shachi in forum JavaScript
    Replies: 35
    Last Post: 07-29-2006, 09:50 AM

Tags for this Thread

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
  •