Custom JavaScript function not being called -


i have written custom function image slider not called

following code.

carousel: {   init: function() {       // main function run   }   previous: function() {      // function run when want go   },   next: function() {     // function run when want go forward   } } 

and calling onclick=javascript:previous() following error on console :

previous() not defined 

if carousel top level of object.

you need call function previous referring property of object:

onclick=carousel.previous() 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -