Ascoos Cms -- Load extra css and js if client is mobile

<?php // Load main front theme css of template. $app->addStyleFromFile($objThemes->loadThemeUrl('fronts', $cur_template)."/css/theme.css"); if ( $objBrowser->isMobile() ) { // do for mobile // Load extra CSS file with code only for mobiles. $app->addStyleFromFile($objThemes->loadThemeUrl('fronts', $cur_template)."/css/mobile.css"); $app->addScriptFromFile($objThemes->loadThemeUrl('fronts', $cur_template)."/js/script.js", true); } ?>
example for load extra CSS code for mobile client.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.