javascript - Problems with my js/jquery code for application frames -


my problem have loaded application frame in js via funtion created called createframe(). fullscreen functionality isn't working ass goes fullscreen nicely if move application frame around desktop not work when move it's original position. code changes size of application frame , temporally remove taskbar , user/time info pane @ top. doesn't seem want allow use touch box minimize/exit/fullscreen buttons in. hides , leave me blank screen. code works follows: var app; creates new application frame(exit/fullscreen/minimize button + content). width , height defined w , h in functions first line called upon in js file called front-end.js calling createframe(500,300); . content_src should explain quit although parameter in not used yet. fullscreen button should able work stated above reason int wont work if drag around on screen. ok have not worked out code re-position 0,0 on screen. if re-position 0,0 myself in desktop not end @ 0,0 of screen. think has me upsetting position i.e. application not in draggable state till moved it. ideas?

var isfullscreen;  function createframe(w,h,content_src) {     var app = $('<div class = "application-frame ui-resizable-se" style="width:'+w+'px; height:'+h+'px;">\                     <div class = "buttons-box">\                         <div class = "exit-button">\                         </div>\                         <div class = "fullscreen-button">\                         </div>\                         <div class = "minimise-button">\                         </div>\                     </div>\                     <div class = "content">\                     </div>\                  </div>');       var apps = [];     $(".desktop-box").append(app);     apps.push(app);     $(app).draggable({containment:"parent"}).resizable({containment:"parent",maxheight: 678,maxwidth: 1361});      $(".exit-button").click(function() {         for(var = 0; <apps.length;i++) {             apps[i].pop($(app).fadeout('very slow'));             for(var f = 0; f < fullscreenarray.length;f++) {                 if(fullscreenarray[f]) {                     $(".infopane").show();                     $(".info-dropdown").show();                     $(".taskbar").show();                     fullscreenarray[f] = false;                 }             }         }     });      var fullscreenarray = [];     fullscreenarray.push(isfullscreen);      $(".minimisse-button").click(function() {         for(var = 0; <apps.length;i++) {             for(var f = 0; f < fullscreenarray.length;f++) {                 if(fullscreenarray[f]) {                     $(".infopane").show();                     $(".info-dropdown").show();                     $(".taskbar").show();                     fullscreenarray[f] = false;                     apps[i].pop($(app).slidetoggle('very slow'));                 }             }         }     });     var fullscreenwidth = $(".desktop-box").width();     var fullscreenheight = $("body").height()+5;      $(".fullscreen-button").click(function() {         for(var f = 0; f < fullscreenarray.length;f++) {             if(!fullscreenarray[f]) {                 $(app).css({width:fullscreenwidth});                 $(app).css({height:fullscreenheight});                 fullscreenarray[f] = true;                 $(".infopane").hide();                 $(".info-dropdown").hide();                 $(".taskbar").hide();             }else if(fullscreenarray[f]) {                 $(app).css({width:w});                 $(app).css({height:h});                 fullscreenarray[f] = false;                 $(".application-frame").draggable();                 $(".infopane").show();                 $(".info-dropdown").show();                 $(".taskbar").show();             }         }     }); } 

i found solution problem if else trying attempt similar. add $(app).offset({top:0,left:0); in if statement makes isfullscreen true. , work!

share|improve answer

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments