parse.com - Page won't ccroll after dynamically creating HTML with Javascript -
i have created javascript function dynamically creates html string, reason once html loads page no longer scroll. if open chrome developer console of sudden allows page scroll. have checked , think have of required open , close div tags. has seen before.
does have javascript not being able finish before page loads?
any appreciated!
html:
//here call function dynamically create html <div id="memberlist"> <script> $(document).ready(function() { generatemembers(); }); </script> </div>
javascript:
function generatemembers(){ var donetask = false; var trebuser = parse.object.extend("trebuser"); var querytrebuser = new parse.query(trebuser); querytrebuser.find({ success: function(results) { //create member profiles var t ="<div class=\"row-fluid\"><div class=\"span12\">"; (i = 0; < results.length; i++) { //var member = results[i]; //alert("results length: " + results.length); t += "<div class=\"span3\">\ <div class=\"met_team_member\">\ <div class=\"met_team_member_preview\">\ <img src=\"photos/teammembers/1.jpg\" alt=\"\" />\ <div class=\"met_team_member_overlay\">\ <div class=\"met_team_member_skill\"><div style=\"width: 100%\"><span class=\"met_bgcolor_trans met_color2\">photoshop</span></div></div>\ <div class=\"met_team_member_skill\"><div style=\"width: 100%\"><span class=\"met_bgcolor_trans met_color2\">illistration</span></div></div>\ <div class=\"met_team_member_skill\"><div style=\"width: 100%\"><span class=\"met_bgcolor_trans met_color2\">photography</span></div></div>\ <div class=\"met_team_member_skill\"><div style=\"width: 100%\"><span class=\"met_bgcolor_trans met_color2\">html</span></div></div>\ </div>\ </div>\ <div class=\"met_team_member_details met_bgcolor3 met_color2\">\ <h2 class=\"met_title_stack\">designer</h2>\ <h3 class=\"met_title_stack met_bold_one\">erkan doe</h3>\ <p>lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore magna aliqua. </p>\ </div>\ <div class=\"met_team_member_socials met_bgcolor clearfix\">\ <a href=\"http://www.facebook.com/\" target=\"_blank\" class=\"met_color2\"><i class=\"icon-facebook\"></i></a>\ <a href=\"http://www.twitter.com/\" target=\"_blank\" class=\"met_color2\"><i class=\"icon-twitter\"></i></a>\ <a href=\"http://www.google.com/\" target=\"_blank\" class=\"met_color2\"><i class=\"icon-google-plus\"></i></a>\ <a href=\"mailto:info@metcreative.com\" target=\"_blank\" class=\"met_color2\"><i class=\"icon-envelope\"></i></a>\ </div>\ </div>\ </div>"; if ((i+1) % 4 == 0){ t += "</div></div><div class=\"row-fluid\"><div class=\"span12\">"; } } t += "</div></div>"; document.getelementbyid('memberlist').innerhtml = t; }, error: function(results, error) { alert("error: " + error.code + " " + error.message); } }); }
Comments
Post a Comment