Wednesday 26 July 2017

Mobile & tab device rotation page refresh



Device rotation page will get refresh


jquery_var(window).on("orientationchange",function(event){
                  console.log('window change');
                  var width = 768;
                  var windowwidth = jquery_var(window).width();
                  var windowheight = jquery_var(window).height();
                 
                  console.log('width...'+width);
                  console.log('windowwidth...'+windowwidth);
                  console.log('windowheight...'+windowheight);
                 
                  if(((windowwidth <= width) && (windowheight >= width)) || ((windowwidth >= width) && (windowheight <= width)))
                  {
                        console.log('Inside.. condition ...');
                        window.location.reload(true);
                  }
            });

Monday 24 July 2017

Window size measurement


<div id="divInitial"></div>
<div id="divResize"></div>

$("#divInitial").text("Initial Window width: " + $(window).width() + ", height: " + $(window).height() + ".");

//Event to handle resizing
$(window).resize(function () {
    var winwidth = $(window).width();
    var width = winwidth+"px"
    var winheight = $(window).height();
    var height = winheight +"px"
    //alert("width:"+ width + " and height:"+ height);
    $("#divResize").text("Window width: " + width + ", height: " + height + ".");
});

Monday 3 July 2017

Mobile & tablet view Portlet place change

if(jquery_var(window).width() <= 768){
         var div1 = jquery_var("#p_p_id_invitationAppportlet_WAR_employerwatchListportlet_");
         jquery_var('#p_p_id_companyInfoportlet_WAR_companyInfoportlet_').insertBefore(div1);
 }

Bootstrap accordion only mobile & tablet



<script>
if(jquery_var(window).width() <= 768){
    jquery_var('#pan').addClass('panel');
    jquery_var('#pan-head').addClass('panel-heading');
    jquery_var('#pan-title').addClass('panel-title');
    jquery_var('#pan-click').addClass('pull-right clickable');
    jquery_var('#pan-body').addClass('panel-body panel-body-white');
}
</script>

Add & Remove Attribute
jquery_var("#Id").removeAttr("readonly");