Plugin Directory

Changeset 764791


Ignore:
Timestamp:
08/30/2013 03:31:51 PM (13 years ago)
Author:
33themes
Message:

better description, new example for js in funcitons.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttt-devices/trunk/readme.txt

    r762950 r764791  
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
    10 Description: Simple way to detect the client device at php level.
     10Custom device performance.
     11
     12Make your Responsive Design better. Beyond CSS @media Queries.
    1113
    1214
     
    1719= Identify the device with a CSS body class =
    1820
    19 Based on http://wordpress.org/extend/themes/thematic
     21Based on http://wordpress.org/extend/themes/thematic with some improvements!
    2022
    2123We add a "body_class" filter with the device information:
     
    5355`
    5456
    55 And also some for IE, nobody worried about it... ;)
     57And also some for IE ;)
    5658
    5759
     
    104106`
    105107
     108= Stop loading some js for mobile =
     109
     110Is very usefull if you need to make your site faster for mobile or tablet, this browsers can handle well some javascripts effects. You can stop remove them from a device like this:
     111
     112`
     113function heavyanimation_script() {
     114    if ( is_tttdevice('desktop') ) {
     115        wp_enqueue_script( 'heavyanimation', get_template_directory_uri() . '/js/havyscript.js', array('jquery'));
     116    }
     117}   
     118add_action('wp_enqueue_scripts', 'heavyanimation_script');
     119`
     120This means that js only load in desktop devices, easy :)
    106121
    107122
     
    112127e.g.
    113128
    114 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
     1291. Upload `ttt-devices` folder to the `/wp-content/plugins/` directory
    1151301. Activate the plugin through the 'Plugins' menu in WordPress
    116131
Note: See TracChangeset for help on using the changeset viewer.