Im trying to use this plugin:
http://www.marghoobsuleman.com/jquery-image-dropdown
I cannot get it to work in my file. I copied and pasted the code from the example files and made the necessary links to 开发者_开发技巧the js and css files just to test, and i still cant get it to work. Everytime i run it, i get this error:
Error: Result of expression '$(".mydds").msDropDown' [undefined] is not a function
The script im using to run the file is:
<script language="javascript" type="text/javascript">
function showvalue(arg) {
alert(arg);
//arg.visible(false);
}
$(document).ready(function() {
try {
oHandler = $(".mydds").msDropDown().data("dd");
oHandler.visible(true);
//alert($.msDropDown.version);
//$.msDropDown.create("body select");
$("#ver").html($.msDropDown.version);
} catch(e) {
alert("Error: "+e.message);
}
})
</script>
Why am I getting these errors and how can I fix it?
Your syntax seems to be fine.
Can you make sure that the msDropDown
js file is included and is available in the page.
You can use firefox(firebug), chrome and IE8(dev tool) to find out whether the file is downloaded and the plugin is available in the client.
Or
A nasty way will be
alert($("").msDropDown)
or
alert(typeof $("").msDropDown) -- function
Put this before you call the msDropDown()
, it should alert with the function definition.
精彩评论