分区只在桌面上可见 [英] division visible only in desktop
本文介绍了分区只在桌面上可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是一名自由职业者,我正在使用asp.net c#做一个网站。任何人都可以告诉我如何在html中进行分割
Hi,
I am a freelancer and i am doing a website using asp.net c#.Can any one tell me how to make a division
只能在desktop.God中看到祝福你。
in html visible only in desktop.God bless you.
推荐答案
有许多方法可以使用javascript检测浏览器是否可以移动。
检测移动浏览器更容易 - 因此也可以间接检测桌面浏览器 - 因为如果浏览器不是移动设备,那就是桌面。
检查此链接。网上有大量的免费代码示例。
一旦你有一个javascript函数来检测浏览器是否是移动的,你可以运行一些javascript DOM加载隐藏div与背景图像。
例如,使用jQuery:
There are many ways to detect, using javascript, whether a browser is mobile or not.
It's easier to detect a mobile browser - and thus indirectly desktop browsers - because if a browser is not mobile, it's desktop.
Check this link out. There are heaps of free code samples on the web.
Once you have a javascript function to detect whether a browser is mobile or not, you can then run some javascript on DOM load to hide the div with the background image.
Forexample, using jQuery:
( document )。ready( function (){
// 您可以通过上面的链接找到可以重命名为isMobileBrowser()的大量功能。
if (isMobileBrowser()){
// 将bk_image更改为div的id。
(document).ready(function () { //You can find heaps of functions that you can rename "isMobileBrowser()" through the link above. if (isMobileBrowser()) { //change bk_image to whatever the id of your div is.
(' bk_image')。css(' display',' none');
}
});
('bk_image').css('display', 'none'); } });
希望这会有所帮助: - )
Hope this helps :-)
这篇关于分区只在桌面上可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文