javascript - How do you create a jQuery function with multiple .click() functions within it? -


How or what is a good approach to this function that I am trying to create?

my_script .js

  $ (document) .ready (function () {$ ("# home") click (function () {$ ('. Click here (function () {$ ('.banner'). ({Top: '370px', height: '250 px',}, 1000) return false}} $ ("about #"). ({Top: '20px', height: '145px',}, 1000) Return false} $$ ("# games"). Click (function () {$ ('.banner'). ({Top: '20px', height: '145px'}, $ 1000) Return (false)} $ $ ("# district") Click (function () {$ ('.banner') .at ({top: '20px Return '(' top '' 20px ', height:' 145px ', '1', 1000) return false}}} ($ 1) if about "[" "," Concussion "I" is clicked on an ID in the "game", "district", "game", "membership"], then I have to make some things live. But if ID = "home", I want to animate it (or that The page is not to be alerted alaried).  

Obviously, I posted this code, did not work, but what kind of approach would you suggest? Do I have to bind the ID of my page Want to alert me in an array and loop at the top? (How does it look) or should I make many different functions, a copy ID, like now?

/ w

Instead of a normal class To use id besides assign home, as you have the same code for other items.

  $ ("# home"). Click (function () {$ ('.banner'). Animate ({top: '370px', height: '250 px',}, 1000) return false;}); Click on $ (".classicxcepthome") (function () {$ ('.banner'). ({Top: '370px', height: '250px',}, 1000) return false;});    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -