Changing background image when hovering on a list item

As you can see in the screenshot, I've got an unordered list. Now the div of this list has a background image. What I want to do is to change background's image whenever I hover the mouse on a list item. Note that every item should change background to a different image. How do I do this? I've only found answers how to change to a single, not multiple images. Here's the scr

悬停在列表项目上时更改背景图像

正如你在截图中看到的,我有一个无序列表。 现在这个列表的div有一个背景图片。 我想要做的是每当将鼠标悬停在列表项上时更改背景图像。 请注意,每个项目都应将背景更改为不同的图像。 我该怎么做呢? 我只找到答案如何更改为单个而不是多个图像。 这是截图。 我已经徘徊在列表的第一项。 div的CSS: .body { display: block; float: left; background-image: url("bgdef.jpg"); background-repeat: no-repe

How to make the 'clickable hand' appear in an HTML document?

I built a sample HTML webpage recently, and when I hover the mouse pointer over a <div> element that makes a drop down menu come down on click, the pointer changes to a cursor, allowing me to highlight the text in the <div> . The thing is, I don't want the mouse pointer to change to a cursor.(I don't want to be able to highlight the text either.) I want it to either remain t

如何让“可点击的手”出现在HTML文档中?

我最近构建了一个示例HTML网页,当我将鼠标指针悬停在一个使下拉菜单点击的<div>元素上时,指针变为光标,允许我突出显示<div>的文本, 。 问题是,我不希望鼠标指针变成光标(我不希望能够突出显示文本)。我希望它保持原来的样子或更改为“clickable当鼠标指针悬停在链接上时,该指针就会出现。 我怎样才能做到这一点? 游标可以使用CSS cursor属性进行更改。 cursor:pointer; https://css-tricks.com/alma

Disable scroll on textarea

I'm trying to make the textarea unscrollable but i'm unable to find a way to get the textarea unscrollable. I've made a simple example in jsfiddle Thanks in advance. Just add in the css file: textarea { resize: none; } or: <textarea rows="10" cols="45" placeholder="Animatie:" name="description" style="resize: none"></textarea> Fiddle: https://jsfiddle.net/p6am6

在textarea上禁用滚动

我试图让textarea不可滚动,但我无法找到一种方法来获取textarea unsocrollable。 我在jsfiddle中做了一个简单的例子 Thanks in advance. 只需在css文件中添加: textarea { resize: none; } 要么: <textarea rows="10" cols="45" placeholder="Animatie:" name="description" style="resize: none"></textarea> 小提琴:https://jsfiddle.net/p6am6dze/2/ 试试这个CSS属性: textarea { overflow: hi

why is it possible to change the size of a text box?

This question already has an answer here: How to disable resizable property of textarea? 13 answers How to disable the resize grabber of an HTML <textarea>? [duplicate] 3 answers

为什么可以改变文本框的大小?

这个问题在这里已经有了答案: 如何禁用textarea的可调整大小的属性? 13个答案 如何禁用HTML <textarea>的大小调整器? [重复] 3个答案

How can I make user not allow to resize textarea?

This question already has an answer here: How to disable resizable property of textarea? 13 answers textarea { resize:none; } <textarea rows="3"></textarea>尝试这个<textarea rows="4" cols="50" style="resize:none;"> At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies. </textarea> 尝试这个<h

我如何让用户不允许调整textarea的大小?

这个问题在这里已经有了答案: 如何禁用textarea的可调整大小的属性? 13个答案 textarea { resize:none; } <textarea rows="3"></textarea>尝试这个<textarea rows="4" cols="50" style="resize:none;"> At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies. </textarea> 尝试这个<html> <head> <

javascript looping and deleting object properties

I have an object with various properties. The name of the object is a global variable but the properties are changed at runtime by methods. Some methods add properties to the object. I'd like to add a method that loops through this object and removes all of its properties that are either null or empty. I could check each property by specifying its name and checking its state but if I add

javascript循环和删除对象属性

我有一个具有各种属性的对象。 对象的名称是一个全局变量,但属性在运行时由方法更改。 有些方法为对象添加属性。 我想添加一个方法来遍历这个对象,并删除它的所有属性为null或空。 我可以通过指定其名称并检查其状态来检查每个属性,但如果稍后添加属性,我也必须更新此清理方法。 如何在不知道属性名称的情况下循环浏览对象的属性。 感谢您的建议。 迭代一个对象很简单 - for in循环: for (var key in object) {

How to list the functions/methods of a javascript object? (Is it even possible?)

This question is intentionally phrased like this question. I don't even know if this is possible, I remember vaguely hearing something about some properties not enumerable in JS. Anyway, to cut a long story short: I'm developing something on a js framework for which I have no documentation and no easy access to the code, and it would greatly help to know what I can do with my objects.

如何列出javascript对象的函数/方法? (它甚至有可能吗?)

这个问题是故意措辞像这个问题。 我甚至不知道这是否可能,我记得隐约听到一些关于JS中不可枚举的属性。 无论如何,简单来说就是:我在js框架上开发了一些东西,我没有文档,也没有简单的代码访问,这对我知道我可以用我的对象做什么很有帮助。 我认为这是你正在寻找的东西: var obj = { locaMethod: function() { alert("hello"); }, a: "b", c: 2 }; for(var p in obj) { if(typeof obj[p] === "function") { /

Get all keys of a JavaScript object

I was wondering if there was a quick way to extract keys of associative array into an array, or comma-separated list using JavaScript (jQuery is ok). options = {key1: "value1", key2: "value2"}; Result should be the array: ["key1", "key2"] or just a string: "key1, key2" You can easily get an array of them via a for loop, for example: var keys = []; for(var key in options) { if(options.has

获取JavaScript对象的所有键

我想知道是否有一种快速的方法来将关联数组的键提取到数组中,或者使用JavaScript(jQuery可以)以逗号分隔的列表。 options = {key1: "value1", key2: "value2"}; 结果应该是数组: ["key1", "key2"] 或者只是一个字符串: "key1, key2" 您可以通过for循环轻松获取它们的数组,例如: var keys = []; for(var key in options) { if(options.hasOwnProperty(key)) { //to be safe keys.push(key); } } 然后使用

How to get an object's properties in JavaScript / jQuery?

In JavaScript / jQuery, if I alert some object, I get either [object] or [object Object] Is there any way to know: what is the difference between these two objects what type of Object is this what all properties does this object contains and values of each property ? You can lookup an objects keys + values by invoking either Javascripts native for in loop: var obj = { foo: 'ba

如何在JavaScript / jQuery中获取对象的属性?

在JavaScript / jQuery中,如果我alert某个对象,我会得到[object]或[object Object] 有什么方法可以知道: 这两个对象有什么区别 这是什么类型的对象 此对象包含的所有属性以及每个属性的值 ? 您可以通过for in循环中调用JavaScript本地代码来查找对象键+值: var obj = { foo: 'bar', base: 'ball' }; for(var key in obj) { alert('key: ' + key + 'n' + 'value: ' + obj[key]); } 或者使用

How to escape a JSON string to have it in a URL?

Using Javascript, I want to generate a link to a page. The parameters to the page are in a Javascript array that I serialize in JSON. So I would like to generate a URL like that : http://example.com/?data="MY_JSON_ARRAY_HERE" How do I need to escape my JSON string (array serialized) to include it as a parameter in a URL ? If there's a solution using JQuery I'd love it. Note: Yes,

如何转义JSON字符串以将其放入URL中?

使用Javascript,我想生成一个页面的链接。 该页面的参数位于我用JSON序列化的Javascript数组中。 所以我想生成一个这样的URL: http://example.com/?data="MY_JSON_ARRAY_HERE" 我如何需要转义我的JSON字符串(数组序列化)以将其作为参数包含在URL中? 如果有使用JQuery的解决方案,我很乐意。 注意:是的,页面的参数需要在一个数组中,因为它们有很多。 我想我会使用bit.ly来缩短链接。 encodeURIComponent(JSON.s