jQuery slideToggle()不工作在Firefox和IE浏览器,但其工作正常在Chrome
问题描述:
我已经使用slideToggle()jQuery函数。如果我点击它的滑动按钮,但它在Firefox和IE浏览器中的秒数消失。但它在Chrome中正常工作。我已经使用三到四个div在一边,一个提交按钮。这是问题吗?请帮助。请检查吹码。jQuery slideToggle()不工作在Firefox和IE浏览器,但其工作正常在Chrome
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#moreqts").hide();
$("#continue_filling").click(function(){
$("#moreqts").slideToggle("slow");
});
});
</script>
<form action="<?php $this->form->getAction(); ?>" method="post" style="<?php echo $mythoughtOptForm; ?>">
<div>
<p id="continue_filling">Continue filling</p>
</div>
<div id="moreqts">
<div class="food"><table border="1px"><tr style="width:200px; text-align:center;"><td></td><td>Road Side</td><td>Indian</td><td>Fine Dining</td><td>Chinese</td><td>Thai</td><td>Continental</td><td>Italian</td></tr>
<tr><td style="width:90px;">Places to eat</td><td><div class="field">
<?php echo $this->form->places_junk_food->renderViewHelper(); ?>
</div></td><td><div class="field">
<?php echo $this->form->places_indian->renderViewHelper(); ?>
</div></td><td><div class="field">
<?php echo $this->form->places_fine_dining->renderViewHelper(); ?>
</div></td><td><div class="field">
<?php echo $this->form->places_chinese->renderViewHelper(); ?>
</div></td><td><div class="field">
<?php echo $this->form->places_thai->renderViewHelper(); ?>
</div></td><td><div class="field">
<?php echo $this->form->places_continental->renderViewHelper(); ?>
</div></td><td><div class="field">
<?php echo $this->form->places_italian->renderViewHelper(); ?>
</div></td></tr>
</table></div>
<div class="sub-field">
<input type="hidden" name="optForm" value="mythought">
<input type="button" name="opt_back" id="opt_back" value="Back" style='width:100px;'> <input type="submit" name="submitOptMyThought" id="submitOptMyThought" value="Save" style='width:100px;'> <input type="button" name="later" id="later" value="Fill it Later" style='width:100px;'>
</div>
答
使用<!doctype html>
如果是HTML5,因为我可以看到,如果你只使用src=""
没有type=text/javascript
你想达到什么样的影响? id“continue_filling”对我来说没有任何意义,因为它所做的只是显示和隐藏“moreqts”。也许需要链接到您的网页或更好的解释 – Dogoku 2013-03-09 12:17:48