使用.less的自定义光标 [英] Custom cursor with .less

查看:185
本文介绍了使用.less的自定义光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Joomla 2.5和Gantry-powered主题。我试图构建一个自定义文本类型与.less,我的方式是从我的深度。
文本是可点击的,并播放音频文件。现在我正在寻找一个干净的方式,以便能够更改文本属性网站范围,而不必每次编辑每个文章。我试图在一个.less文件中创建一个自定义类,这将改变鼠标悬停,但我不能让它工作。

I am using Joomla 2.5 with a Gantry-powered theme. I am trying to build a custom text type with .less, and I am way out of my depth. The text is clickable, and that plays an audio file. Now I am looking for a clean way to be able to change the text attributes site-wide without editing every article every time. I am trying to make a custom class in a .less file that will change the mouse cursor on hover, but I can't get it to work at all.

在这里是如何设置音频:

Here is how I set up the audio:

<audio type="audio/mpeg" id="all" src="images/audio/BlackFriday/p2.mp3"></audio>
<div class="aa"><a onclick="document.getElementById('p2').play()">Black Friday sales are not all they are cracked up to be.</a></div>

我试图使用在.less文件中定义的类aa。以下是.less文件的全部内容:

I am trying to use the class "aa", which is defined in a .less file. Here are the entire contents of the .less file:

/** audio playing text. includes font and cursor*/
.aa {
    cursor: url(images/headphones.cur);
}



我也尝试过使用span调用类aa对我来说这是一个新的领域,所以我可能已经离开了这个。

I have also tried using span to call the class "aa", but to be honest this is new territory for me so I may be way off with how I'm going about this.

这是.less文件的路径:

This is the path for the .less file:

templates/rt_spectral/less/template-custom.less

而对于光标文件:

images/headphones.cur

任何对发生的事情的想法将是一个巨大的帮助。谢谢。

Any thoughts on what is going on would be a huge help. Thanks.

推荐答案

非常感谢Jarno的快速反应。
我得到这个照顾,但我不得不添加一些其他的东西,我没有遇到过。
现在是我的.less文件:

Thanks so much for the quick response Jarno. I got this taken care of, but I had to add some other things that I hadn't come across before. Here is my .less file now:

.aa {cursor: url(/images/listen.cur), progress !important;}

需要很长时间才能使任何东西正常工作,直到我添加

It took a long time to get anything to work properly, and it wasn't until I added

progress !important

光标更改。我明白!重要的,但我找不到任何进展!重要的,虽然没有没有效果没有它。
再次感谢!没有你的相对路径帮助没有什么工作。

that the cursor changed. I understand !important, but I couldn't find anything on progress !important, although there is no effect without it. Thanks again! Nothing would have worked without your relative path help.

这篇关于使用.less的自定义光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆