thank you for your replies and suggestions.
this is not an animation. the code uses a .each to designate and draw small square divs into which the next line of code pastes an image. i put in an alert to stop the process at each iteration, just so i could be sure i understood what was going on. to slow things down a bit for easier understanding.
while the alert did slow things down for the execution of the first element, it doesn't for the second.
Here is my code :
- <!doctype html>
- <html lang="en">
- <head>
- <title>test</title>
- <meta charset='utf-8'>
- <script type="text/javascript" src="jquery-1.9.1.min.js"></script>
- <style>
- body{display:block; padding:0px; margin:0px; background-color:gray; overflow:auto;}
- .thumb{width:150px; height:150px; margin-left:8px; margin-top:0px; margin-bottom:8px; padding-bottom:0px; float:left; background-position: 50% 100%; background-size:cover; border:3px solid white;}
- </style>
-
- <script>
- $(document).ready(function()
- {
- var manifest=
- {
- 1:{
- available:"n",
- filename:"c.jpg",
- },
-
- 5:{
- available:"n",
- filename:"pic2.jpg",
- },
-
- 7:{
- available:"n",
- filename:"pic3.jpg",
- }
- }
-
- $.each(manifest, function(param1, param2) {
-
- $("#thumb").append("<button type='button' id='"+param1+"' class='thumb'></button>"); //the first parameters are 1,5,7
-
- $("#"+param1).css('background-image', 'url("D:/JS Practice/'+param2.filename+'")'); //the second parameters are contained in pairs inside the braces {}
- //this statement says, for each first parameter id'd div,
- //the background image URL is the second parameter's value
- alert("oop");
-
- });
- alert("mope");
-
- });
-
-
- </script>
-
- </head>
-
- <body>
-
- <div id="visiblePage">
- <div id="thumbBox">
- <div id="thumb"></div>
- </div>
- </div>
-
- </body>
- </html>
i have tried many variations and combinations of alerts, position changes, in & out of the first function, but i can't get the second command (line 41) to step through.
i don't get why the first command (line 39) steps thru, including the "oop" alert, then shows the "mope" alert, then executes line 41 with no stepping at all.