javascript - Hiding background elements is a good idea? -


i have mobile website. it's ajax based , when clicking row table in main screen, div populated ajax data , fades in, occupying whole window, in fixed position. user can navigate div if it's separate window can out main table (fading out fixed div). so, when user navigate fixed div, in reality there main page body in background. disabling/hiding background main page make website more lightweight mobile or not? structure similar to:

<html> <head> <script> function navigatein(url){ $.get(url,function(data){ //get data url $('#navigate').html(data); //put data div $('#navigate').fadein(200,function(){ //fade in div //now, after div faded in, hide background: $('#main').css('overflow','hidden'); //is helpful? $('#main').css('visibility','hidden'); //is helpful? $('#main').css('display','none'); //is helpful? void scrolltop of body, it's not greatest choice }); }); } function navigateout(){ //display main page before out! $('#main').css('overflow','');  $('#main').css('visibility','');  $('#main').css('display',''); $('#navigate').fadeout(200); } </script> <style> #navigate { position: fixed; height: 100%; width: 100%; top: 0; bottom: 0; left: 0; right: 0; overflow: auto; } </style> </head> <body> <div id="main"> <button onclick="navigatein('http://www.test.com');">navigate in!</button> </div> <div id="navigate"></div> </body> </html> 

here's jsfiddle showing i'm talking about: jsfiddle effect bit different because it's not full screen view. don't know how test myself if it's helpful or not (or worse) hide content. ask you. ps: know it's not beautiful effect when fading in, in reality made slidein right extension, it's better...


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -