A method of positioning sliding effect in jquery layer animation

Source: Internet
Author: User

This paper illustrates the method of positioning the sliding effect of jquery layer animation. Share to everyone for your reference. The implementation methods are as follows:

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 5, 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 11 9 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148-149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179-18 0 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203-204 <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <title>jquery Layer animation positioning slip </title> < Style type= "Text/css" > <!--body {font-family: ' Signika Negative ', Sans-serif;} #head {z-index:10; Position:absol Ute top:0; left:0; width:100%; height:30px; Border-color: #0055ff; border-width:0 0 10px 0; Border-style:solid; Background: #0088ff; #head li{list-style:none; float:left; display:block; height:30px; padding:0 10px; 0 10px; Cursor:pointer; font-size:26px; #head li:hover{color: #ffffff; background: #0055ff; Border-color: #0011ff; border-width:0 0 10px 0; Border-style:solid; } #box {position:absolute; top:0; left:0; width:100%; height:100%; overflow:hidden;} #bg {position:absolute; top:0; lef t:0; width:100%; height:100%; overflow:visible; Background:; }. cell {width:100%; height:100%; Overflow:auto}. list {position:absolute; top:50%; left:50%; width:800px; height:600px; margin:-300px 0 0-400px; Background: #0088ff; #class_1 {position:absolute; top:0; left:0; background:;} #class_2 {position:absolute; top:0; left:100%:; } #class_3 {position:absolute; top:0; left:200%; background:;} #class_4 {position:absolute; top:100% Nd:; } #class_5 {position:absolute; top:100%; left:100%; background:;} #class_6 {position:absolute; top:100%; BAC Kground:; } #class_7 {position:absolute; top:200%; left:0; background:;} #class_8 {position:absolute; top:200% Ound:; } #class_9 {position:absolute; top:200% left:200%; background:;}--> </style> <script type= "Text/javascrip T "src=" js/jquery-1.6.2.min.js "></script> <script type=" Text/javascript "> $ (document). Ready ( Function () {$ ("#l_01"). Click (function () {$ ("#bg"). Stop (). Animate ({top:0+ "%", left:0+ "%"}, "slow"); $ ("#l_02"). Click (function () {$ (#bg). Stop (). Animate ({top:0+ "%", left:-100+ "%"}, "slow"); }); $ ("#l_03"). Click (function () {$ ("#bg"). Stop (). Animate ({top:0+ "%", left:-200+ "%"}, "slow"); $ ("#l_04"). Click (function () {$ ("#bg"). Stop (). Animate ({top:-100+ "%", left:0+ "%"}, "slow"); $ ("#l_05"). Click (function () {$ ("#bg"). Stop (). Animate ({top:-100+ "%", left:-100+ "%"}, "slow"); $ ("#l_06"). Click (function () {$ ("#bg"). Stop (). Animate ({top:-100+ "%", left:-200+ "%"}, "slow"); $ ("#l_07"). Click (function () {$ ("#bg"). Stop (). Animate ({top:-200+ "%", left:0+ "%"}, "slow"); $ ("#l_08"). Click (function () {$ ("#bg"). Stop (). Animate ({top:-200+ "%", left:-100+ "%"}, "slow"); $ ("#l_09"). Click (function () {$ ("#bg"). Stop (). Animate ({top:-200+ "%", left:-200+ "%"}, "slow"); }); </script> </head> <body> <div id= "Head" > <li id= "l_01" >1</li> <li id= "l_02" > 2</li> <li id= "l_03" >3</li> <li id= "l_04" >4</li> <li id= "l_05" >5</li> < Li id= "l_06" >6</li> <li id= "l_07" >7</li> <li id= "l_08" >8</li> <li id= "l_09" >9</li> </div> <div id= "box" > <div id= "bg" > <div class= "Cell" Id= "Class_1" > <div class= "list" ></div> </div> <div class= "cell" id= "class_2" > <div class = "List" ></div> </div> <div class= "cell" id= "Class_3" > <div class= "list" ></div> </ div> <div class= "cell" id= "Class_4" > <div class= "list" ></div> </div> <div class= "cell" id = "Class_5" > <div class= "list" ></div> </div> <div class= "cell" id= "Class_6" > <div class= " List "></div> </div> <div class=" cell "id=" class_7 "> <div class=" list "></div> </ div> <div class= "cell" id= "Class_8" > <div class= "list" ></div> </div> <div class= "cell" id = "Class_9" > <div class= "list" ></div> </div> </div> </div> </body> </html >

I hope this article will help you with your jquery programming.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.