Thứ Sáu, 16 tháng 6, 2023

Iphone Safari issue toolbar over at bottom

 

Solutions

#1: IOS 16.4 support above 100svh,lvh,dvh (small,large,dynamic view height): old version not supoport
#2: Padding 105px: always have space at bottom
#3: Script view check screen view height: SOLVED this is the best way. This solution reuse idea

https://viblo.asia/p/sua-loi-100vh-tren-thiet-bi-ios-safari-gGJ59GEjZX2

jQuery(document).ready(function(){

const windowHeight = () => {
        var svh = window.innerHeight;
        console.log(svh);
        /*set*/       
        jQuery('#i_display_container_fixed').css('height',svh+'px');
    }
    window.addEventListener('resize', windowHeight);
    windowHeight();

});

Thứ Ba, 30 tháng 5, 2023

HTML to top-bottom-anchor animation

HTML to top, to bottom anchor animation
2 ways:
Jquery is complex
The easiest way add css

/*add to css*/

html {
  scroll-behavior: smooth;
}

Thứ Ba, 9 tháng 5, 2023

Jquery array rename key - CLEAR



Có nhiều cách làm trên internet nhưng bị lỗi, khó hiểu
Cách làm đơn giản nhất là replace string json

myArray = {oldKey1: 'value1', oldKey2: 'value2', another: '1'}
Change oldKey1 = newKey1


/*Object to string*/
var jsonMap = JSON.stringify(myArray);
/*Key replace by newkey*/
var jsonMapReplace = jsonMap.replace(oldKey1,newKey1);
/*string to JSON again*/
myArray = JSON.parse(jsonMapReplace);

Thứ Năm, 2 tháng 2, 2023

Wordpress Twitter feed by Smash Balloon setting

 Detail: plugin Twitter feed by Smash Balloon


Thứ Tư, 28 tháng 12, 2022

Wordpress Directory plugin select 2 issue Iphone

 Detail: Wordress use plugin Directorist - Business Directory Plugin
Safari iphone select2 can not select
Step: input click -> select popup view above, this issue popup view in range click too : this mean selected and hide popup


Solution: popup above move top out range click by CSS

/*mobileSelectIssue*/
body .select2-container--open .select2-dropdown--above{
    top:-2px;
}


 

Thứ Tư, 7 tháng 12, 2022

Wordpress add widget position

 1. Load position: position may be header, footer, main view

        <?php
            if (is_active_sidebar('logobox')){
                dynamic_sidebar('logobox');
            }
            ?>

2. Init functions.php

/*TopBox*/
function CustomLogoBox()
{
    register_sidebar(array(
        'id' => 'logobox',
        'name' => 'Logo Box',
        'description' => 'Logo box text',
        'before_widget' => '<div class="logobox">',
        'after_widget' => '</div>',
        'before_title' => '<h3 class="logo-widget-title">',
        'after_title' => '</h3>'
    ));

}
add_action( 'widgets_init', 'CustomLogoBox' );

3. Wordpress admin add widget



Thứ Hai, 21 tháng 11, 2022

 mplugin wordpress malware

Detail: November 2022 client report 5 sites issue malware.
This effect mobile only, when site wordpress at FRONT END click will open other site

Solution: backup files before edit
Setup: 'wordfence plugin'>Scan >list issue

Step by step: as detail report
1. theme /functions.php : require clean code
2. mplugin.php : this is malware -> remove
3. theme/ template-config.php clean code