diff --git a/app/assets/javascripts/theater.js b/app/assets/javascripts/theater.js index 785485e..324f0bb 100644 --- a/app/assets/javascripts/theater.js +++ b/app/assets/javascripts/theater.js @@ -40,12 +40,15 @@ window.GalleryTheater = function() { button_play_string = '', button_stop_string = '', playtimeoutID; - var initialize = function() { + var set_margin = function () { if ($('#orbit-bar').height()>0){ //for show page $('#gallery-theater-stage>.gallery').css('margin-top','2.4em') }else{ $('#gallery-theater-stage>.gallery').css('margin-top','') } + } + var initialize = function() { + set_margin(); stage = $("#gallery-theater-stage"); closeBtn = stage.find(".gallery-close"); switchBtn = stage.find(".gallery-theme-switch"); @@ -559,7 +562,10 @@ window.GalleryTheater = function() { $(document).ready(function() { initialize(); - }) + }); + $(window).load(function() { + set_margin(); + }); } // gallery-image gal-prev gal-inactive \ No newline at end of file