为了最大限度地提高移动设备的效率,我宁愿没有用于桌面版本的图像。通过研究,我了解到单纯使用display:none;
css orjQuery('img').hide()
只会隐藏图像,但仍然使用资源来加载它。
我怎么能接受这个:
<div class="com_router_img">
<img src="http://www.example.com/wp-content/uploads/2013/05/img.jpg"
alt="img" width="700" height="350" class="aligncenter size-full wp-image-307" />
</div>
并且不在我的移动样式表上显示它?这是移动样式表查询:
<link rel="stylesheet" media='screen and
(-webkit-min-device-pixel-ratio: 1.4) and (-webkit-max-device-pixel-ratio: 1.5)'
href="<?php bloginfo('template_url'); ?>/smallphone.css" />