Thứ Hai, 26 tháng 11, 2018

CSS transform scale blank space - SOLVED


Description: Responsive view zoom transform scale. This make blank space. Need fix view full
Explain code: Original is 980, <980 auto scale. When scale important: '.container' is  scale + absolute. Absolute is will make html>body auto height again.

Solution:
HTML
<body>
<div class="container">
CONTENT
</div>
</body>

SCRIPT
var jquery = jQuery.noConflict();
jquery(window).ready(function(){
/*ScallFullScreen*/
ZoomScale();
});
jquery( window ).resize(function() { 
/*ScallFullScreen*/
ZoomScale();
});
/*ScallFullScreen*/
function ZoomScale(){
var widthScreen = jquery(window).width();
var scale = 1;
var wrapper = jquery('.container');
if(widthScreen<980){
/*scale=1*/
scale = widthScreen/980;
jquery(wrapper).css('position','absolute');
jquery(wrapper).css('width','980px');
jquery(wrapper).css('overflow-x','hidden');

}else{
jquery(wrapper).css('position','relative');
jquery(wrapper).css('width','auto');
jquery(wrapper).css('overflow-x','auto');
}
jquery(wrapper).css('-webkit-transform', 'scale(' + scale + ')');
jquery(wrapper).css('transform', 'scale(' + scale + ')');
jquery(wrapper).css('transform-origin', 'left top');
}

Thứ Ba, 3 tháng 7, 2018

PHP random array unique multi SOLVED

/*Original Array*/
$arrayIDs = ['a','aa','bb','cc'];
/*Result*/
$randomArray = [];
/*number unique*/
$numberRandom = 4;
if(count($arrayIDs)> $numberRandom){
while(count($randomArray) < $numberRandom) {
  $randomKey = mt_rand(0, count($arrayIDs)-1);
  $randomArray[$randomKey] = $arrayIDs[$randomKey];
}
}else{
$randomArray = $arrayIDs;
}

Thứ Hai, 11 tháng 6, 2018

Joomla HTTPS 2.5, 3.x - Layout broken SOLVED

Step 1:
.htaccess add to top
<IfModule mod_env.c>
   SetEnv HTTPS on
</IfModule>

Step 2:  System / Global Configuration / Server / Force HTTPS = Entire Site