Jquery .animate not working?
Jquery .animate not working?
我和我的开发人员一直在努力让这个JavaScript为主页上的潜在表单和其他表单工作。
http://nextinlinefilms.com.au/index.php这是链接。当你点击"点击此处"时,表格应该向下滑动并显示"今天进行查询"的图像。
这是代码:
$( ".jscript" ).click(function() {
$( ".enquiry" ).animate({height: "auto"},500);
});
它说,当类"jscript"被点击时,将表单类"inquiry"动画化,并使高度自动
代码应该是正确的!?
请帮忙,谢谢。
是javascript创建的.jscript元素,或者用html硬编码的,因为很多时候,这里的问题是当你使用选择器进行onclick时,该元素不存在,而且它不起作用,所以试试这个函数:
$(document).ready(function() {
$("parentOfjscript").on("click", ".jscript", function() { //parentOfjscript being some parent element containing jscript
$(".enquiry").animate({height: "auto"}, 500);
});
});
在页面上创建此选择单击函数之前,请确保.jscript的父元素是dom中已经存在的元素。
相关文章:
- $rootScope not working
- jQuery document.ready not working
- Javascript getElementsByTagName not working?
- JQuery.val( ) not working
- Tomcat websocket is not working
- Javascript JSON.parse not working
- NodeJS Multer is not working
- Regex not working
- Ember run.debounce not working
- AngularJs 1 not working
- document.getElementById.style.backgroundImage not working
- Rxjs5, distinct() is not working
- createOscillator noteOn not working
- Javascript - .getHours() not working
- Javascript setTimeout not working | onkeydown
- MongoDB $pull not working
- Express router.use not working
- JSONP not working
- window.opener not working in chrome & IE
- Backbone + RequireJS: Collection.each() is not working