html5 - JQuery slideToggle problems -


sure there obvious answer 1 don't know it. dynamically loading page using jquery .load() on "loaded" page there form form elements e.g. input type="number" (html5).

is there reason why if slidetoggle() form form elements revert input type="text" yet if toggle() - (just toggle()) elements remain "true" likewise if add toggle('slow') form elements revert input type="text"

ok. html code on "page1" looks this:

<form method="post" id="frmcreate"> <ol></ol> <input type="submit" id="testit" /> </form> 

it loaded - yes doc ready() etc.

$('ul#fieldtypes li a').click(function(){ var id_timestamp = new date().gettime(); var id = $('.inputlength').length; $( "#frmcreate ol" ).append('<li id='+id_timestamp+' class="inputlength"></li>'); $('#'+id_timestamp).load('test1.php?y='+id); return false; 

});

this form loaded

type <input type="text" name="fieldmeta<?php echo $y; ?>[type]" /> <?php echo $error; ?>  <br/> name <input type="text" name="fieldmeta<?php echo $y; ?>[name]" value="<?php echo $y; ?>" /> <?php echo $error; ?>  <br/> <div class="optoggle">options</div> 

these "options" loaded page:

<li>cols<input type="number" name="fieldmeta<?php echo $y; ?>[cols]" /> <?php echo $error; ?></li> <li>rows<input type="number" name="fieldmeta<?php echo $y; ?>[rows]" /> <?php echo $error; ?></li> <li>size<input type="number" name="fieldmeta<?php echo $y; ?>[size]" /> <?php echo $error; ?></li> 

they loaded this:

$('.optoggle').live('click',function(){     $(this).next('div').toggle(); }); 

like @jwegner pointed, your problem isn't jquery browsers support html5.

resuming, today google chrome understands <input type="number" />. mean "the only" because on final version. both firefox 4 , internet explorer 9 promisses understand attribute, on beta or rc , can't considered.

like pointed too, chrome have bug: when parent being animated, children arrows on number field stays hidden. if focus input , use keyboard arrows, you'll see yet works number field. "just" appearance wrong.

it not happens toggle() because parent isn't animated, turns hidden , visible again. toggle("slow") animation happens, described bug too.

i posted workaround here: http://jsfiddle.net/4fbvl/2/, wich based on this: when sliding out, can use animations. show again, must imediatelly.

another workaround use fadein() , fadeout() instead of slideup() , slidedown(). reason, fades doesn't causes bug.

anyway, best option avoid type="number" now. after all, not want page work in chrome, right?


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -