Tag: css3

页面刷新后保持相同的颜色

当我单击div , span的color会变为red ,正如我所料,但是当我刷新页面时, color不是red ,它会返回原始颜色,在我的情况下为green 。 刷新页面后如何保留相同的颜色(红色)? 我用.apend()尝试了事件,但情况是一样的。 这是我的HTML: Green jQuery的: $(‘#changeColor’).click(function(){ $(‘span’).css({“background-color”:”red”}); }); 谢谢大家:D

如何在textarea中显示选定文本下方的div?

我有一个场景,我需要在文本区域中显示一个div(如弹出窗口)选择文本。但是,我使用鼠标按下它,div的位置有时不完全低于文本。 JavaScript的: function getSel() { // obtain the object reference for the textarea> var txtarea = document.getElementById(“mytextarea”); // obtain the index of the first selected character var start = txtarea.selectionStart; // obtain the index of the last selected character var finish = txtarea.selectionEnd; //obtain all Text var allText = txtarea.value; // obtain the selected text […]

使用jquery旋转后其他元素的不当行为

我写了一些代码用于文本旋转,resize和文本拖动。 一开始就一切正常。 请参阅此代码 $( ‘.new-div’).draggable({ containment: “#bord”, create: function() { $(“.new-div”).css(“width”,’auto’); } , drag: function() { $(“.new-div”).css(“width”,’auto’); } , start: function() { $(“.new-div”).css(“width”,’auto’); } , stop: function() { $(“.new-div”).css(“width”,’auto’); } }); $(document).on(“click”,”.closeButton”,function(){ $(this).closest(‘div’).remove(); }); $(‘.new-div’).on(“click”, function(){ var uscontent= $(this).text(); if(uscontent.trim()===”Add Your Text”){ $(‘.mc’).text(”); $(this).css(“width”,”100px”); $(this).css(“height”,”6%”); } }); $(‘.resizeButton’).draggable({ containment: ‘#bord’, drag: function() { $(‘.new-div’).height($(‘.resizeButton’).position().top + […]

使用jQuery的CSS3文本阴影效果

我希望能够创建一个与CSS3 text-shadow属性相同的效果,使其可用于不支持此CSS3属性的浏览器(如IE 7和8)。 所以我找到了两个插件: Text Shadow和Drop Shadow Effect 。 我决定使用Text Shadow,因为它是在2008年底发布的,因为它更直接。 这对IE8非常有用。 但是在IE7中,阴影的距离是文本的两倍,链接很奇怪。 IE8图像替代文字http://img714.imageshack.us/img714/5201/regularz.jpg IE7图像替代文字http://img651.imageshack.us/img651/2569/ie7.jpg 我正在寻找修复,或替代这个问题。

CSS中的砖块布局

我一直试图在CSS中附加图像中创建砖布局两天,但没有任何成功。 请参阅附图 为了实现这种布局,我编写了一些代码。 我试图使用以下HTML复制第一行(带有“Let’s”一词的行) 和CSS .photo-row { width: 100%; height: 200px; } .photo-row.first div { display: inline-block; height: 100%; } .first-item-1 { width: 13.57%; background: red; } .first-item-2 { width: 19.21%; background: green; } .first-item-3 { width: 31.21%; background: orange; } .first-item-4 { width: 15.14%; background: blue; } .first-item-5 { width: 19.78%; background: yellow; } […]

猫头鹰旋转木马,显示孩子绝对div,超过父母溢出隐藏div

我正在使用猫头鹰旋转木马2,我正面临以下问题。 我有一个名为owl-stage-outer父div ,它有overflow:hidden根据轮播的要求overflow:hidden 。 我有另一个孩子div名称: ribbon (显示’New Arrival’和’Big Sale’)这是position: absolute现在我面临的问题,在旋转木马的第一项,function区因为overflow: hidden 参考图像 我正在工作的链接 我试过这个链接提供的解决方案,但它只适用于直接的孩子。 提前致谢。

如何在Select2中插入FontAwesome

我不知道如何在Select2中插入fontawesome。 我应该在其中添加CSS或JS? 我有一个如下的观点。 点击: http : //s10.postimg.org/675fig9vd/Capture121212121.png 谁能帮我?

使用jQuery旋转图像OnClick?

我有这个代码: http : //jsfiddle.net/Q4PUw/2/ 因此,一个简单的HIDDEN TO VISIBLE jQuery脚本。 我想知道怎么做的是在“expand-one”类中有一个图像可以旋转90度,所以图像面朝下而CLASS是可见的,然后一旦它变成隐藏它就会旋转回它的原始图像点。 任何人的想法? 非常感谢! 亚伦

如何从iframe访问文档中的?

我有一个iframe 我在inspector元素中发现img标签位于带有body标签的“#document”中 我需要访问这个img(“landingpage.jpg”)以便更改(图像很小…需要resize),其宽度为100%,高度为:90% 我尝试过使用#Iframe1>#document>html>body>img{width:100%;}

如何使用javascript / jquery在less css中更改主题颜色

我用下面的css来改变不同的主题颜色 @lightRed: #fdd; @lightGreen: #dfd; @lightBlue: #ddf; @defaultThemeColor:@lightBlue; #header{ .wrapper(); width:@defaultWidth; height:80px; margin-bottom:20px; background:@defaultThemeColor; } #menu{ background:@defaultThemeColor; } 而html如下: theme1 theme2 theme3 当点击theme1时,应加载@lightRed主题,对于theme2 @lightBlue和对于theme3 @lightGreen 请让我知道我的javascript / jquery如何在点击时更改主题颜色