我认为这很简单,但经过 2 天的尝试,我仍然一无所知。基本上,如果屏幕超过 767 像素宽,我需要运行一组命令,如果屏幕低于 767 像素,我需要运行另一组命令。
当屏幕宽于 767 像素时,我想:
<script type="text/javascript">
var jsReady = false;//for flash/js communication
// FLASH EMBED PART
var flashvars = {};
var params = {};
params.quality = "high";
params.scale = "noscale";
params.salign = "tl";
params.wmode = "transparent";
params.bgcolor = "#111111";//change flash bg color here
params.devicefont = "false";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
var attributes = {};
attributes.id = "flashPreview";
swfobject.embedSWF("preview.swf", "flashPreview", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
<!-- and much more code... -->
</script>
当屏幕小于 768 像素时,我想运行:
<script type="text/javascript">
jQuery(function($){
$.supersized({
//Background image
slides : [ { image : 'img/some_image.jpg' } ]
});
});
</script>
没错...对于台式机和平板电脑,我想显示全屏视频背景。对于较小的屏幕(小于 767 像素),我想显示单个静止图像背景。