基金会在屏幕外菜单打开时与其他类进行箭头切换
Foundation make arrow switch with other class when off screen menu opens
所以我尝试了各种javascript函数和切换选项,试图使按钮从右箭头切换到左箭头。
.arrow-right {
display: block;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 20px solid white;
margin-left:10px;
}
.arrow-left {
display: block;
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 30px solid white;
transform:
我用来这样做的JavaScript是
$('#showhide').click(function() {
$(this).toggleClass('arrow-left');
});
你可以看到我在jsfiddle中遇到的问题
http://jsfiddle.net/bbarclay6/qbnc1jn7/7/
任何帮助都很棒,很棒:)
你不需要两个类。您需要做的就是根据操作将transform
设置为180deg
和none
:
//Rotate by 180 degrees when "showhide" is clicked i.e. when opening.
$('#showhide').click(function() {
$(this).css("transform", "rotate(180deg)");
});
//Remove the transform when the "exit-off-canvas is clicked i.e. when closing.
$('.exit-off-canvas').click(function() {
$('#showhide').css("transform", "none");
});
更新的小提琴
相关文章:
- 如何添加浮动和非浮动,其他
- 与其他库的jQuery.noConflict()
- 播放当前视频时如何停止其他视频?JavaScript
- 如何将屏幕分辨率乘以 80%,然后在代码中使用
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- 制作一个不带HTML a标记但在动画播放完毕后指向其他页面的超链接
- 在不打开聊天屏幕的情况下制作Zopim-ding代理
- 除修剪外的其他功能
- 是什么让一个“;Uncaught RangeError:超过了最大调用堆栈大小“;错误(Chrome,在其他浏览器中显示
- Array.length似乎不起作用;console.log则显示其他情况
- 如何消除代码中的未定义和其他问题
- 如何覆盖锚点元素's href目标,并在我点击转到目标javascript时删除其他错误
- 使用图像数组列表的simplegallary.js显示适合桌面屏幕的图像
- jquery代码在Mozilla中有效,但在其他浏览器上无效
- 基金会在屏幕外菜单打开时与其他类进行箭头切换
- 打开Chrome或Firefox,不带标签和其他菜单项,并设置屏幕位置和大小
- Canvas将箭头键控件添加到ipad和其他设备的屏幕上
- 运行完所有其他代码后,将显示模式弹出加载屏幕
- GetComputedStyle到屏幕以外的其他媒体
- 如何使UI对其他屏幕尺寸的响应更灵敏