小编Mit*_*nar的帖子

防止图像拖动选择

我已经浏览了整个互联网,但发现没有任何效果.

我希望我的图像不被选中,就像带有背景图像的div(<div style = "background-image : 'moo.png';"> </div>)

我不能使用背景图像,因为我需要一个图像映射功能.

我的代码看起来像这样:

CSS,

.filmmakers #map {

-moz-user-select : -moz-none;
-khtml-user-select : none;
-webkit-user-select : none;
-ms-user-select : none;
-o-user-select : none;
user-select : none;

}

.filmmakers #map::selection {

   color : rgba(0, 0, 0, 0);

}
Run Code Online (Sandbox Code Playgroud)

HTML,

<img id = "map" src = "WorldMap.png" alt = "Map" unselectable = "on" style = "left : 0px; top : 0px;" />
Run Code Online (Sandbox Code Playgroud)

JavaScript的,

var map = document.getElementById('map');

makeUnselectable(map);

function makeUnselectable(node) {

if (node.nodeType == …
Run Code Online (Sandbox Code Playgroud)

javascript select image drag

3
推荐指数
1
解决办法
3914
查看次数

在左侧重复的纹理和在右侧重复的纹理

我不知道怎么做,但我希望有2个重复的纹理,一个重复到左边,一个重复到右边.

代替:

#header {
   background-image : Url('My_Two_Textures_Combined.png');
   background-repeat : repeat-x; /*Which repeats my joined textures a long the x axis*/
}
Run Code Online (Sandbox Code Playgroud)

我想要:

#header {
   background-image : Url('My_Left_Texture');
   background-repeat : repeat-x-left; /*Which would ideally repeat my texture to the left on the x axis*/
   background-image : Url('My_Right_Texture');
   background-repeat : repeat-x-Right; /*Which would ideally repeat my texture to the right on the x axis*/
}
Run Code Online (Sandbox Code Playgroud)

我希望有一种方法可以做到这一点,因为我觉得它在我的网站上看起来不错.我将尝试查看其他方法来执行此操作,例如使用伪命令或其他方法.如果我找到任何东西,我会在这里发布!

html css background-image repeat

2
推荐指数
1
解决办法
293
查看次数

如何防止访客通过检查员查看我的网站?

可能重复:
如何禁用右键单击我的网页?

说我有这个很酷的形象,我不希望它不偷,我不希望别人查看源代码,遗憾的是,由于一些未知的原因,他们所要做的就是打开网页检查,他们有你的形象,CSS,HTML,一切!

为什么这里什么都没有?

我不想在互联网上的任何其他地方看到我非常棒的形象.

如果有人可以帮助我,我会很高兴.

(我知道那里的人有非常棒的图像,谁知道,我才知道!)

干杯^^

Mithos

编辑:他们是怎么做到的?https://dl.dropbox.com/u/107533178/Screen%20shot%202012-11-02%20at%202.00.10%20PM.png

以下是网站链接:

http://player.hulu.com/embed/myspace_player_v002.swf?pid=50023725&embed=false&partner=MySpace&videoID=107805066&autoplay=true&referrer=http%3a%2f%2fvids.myspace.com%2findex.cfm%3ffuseaction%3dvids.individual% 26videoid%3d107805066

javascript

0
推荐指数
1
解决办法
1241
查看次数

使用鼠标拖动来控制背景位置

我想使用'鼠标拖动'在框内拖动背景的位置.

css:

.filmmakers #map {

   width : 920px;

   height : 500px;

   margin-top : 50px;

   margin-left : 38px;

   border : 1px solid rgb(0, 0, 0);

   cursor : move;

   overflow : hidden;

   background-image : url('WorldMap.png');

   background-repeat : no-repeat;

}
Run Code Online (Sandbox Code Playgroud)

html:

<div id = "map" src = "WorldMap.png" onmousedown = "MouseMove(this)"> </div>
Run Code Online (Sandbox Code Playgroud)

javascript:

function MouseMove (e) {

   var x = e.clientX;

   var y = e.clientY;

    e.style.backgroundPositionX = x + 'px';

    e.style.backgroundPositionY = y + 'px';

    e.style.cursor = "move";

}
Run Code Online (Sandbox Code Playgroud)

什么都没有发生,没有错误,没有警告,什么都没有......我尝试了很多东西:div内部的绝对定位图像(你可以猜到为什么不起作用),一个带有背景图像的div内的可拖动div,一个拖放的表,最后我尝试了这个:

function MouseMove () …
Run Code Online (Sandbox Code Playgroud)

javascript javascript-events

0
推荐指数
1
解决办法
4026
查看次数