我正在尝试用图像替换文本。当我将文本缩进-9999px。图片不可点击。如何使图像可点击?
jQuery
$(function() {
$("#left_pane").css("left","-300px");
$("#middle_pane").css("left","0px");
$(".toggle_right_pane").toggle(function() {
$('#left_pane').animate({ left: '0' }, 500);
$('#main_pane').animate({ left: '213' }, 500);
}, function() {
$('#left_pane').animate({ left: '-300' }, 500);
$('#main_pane').animate({ left: '-15' }, 500);
});
});
CSS
#left_pane{
float:left;
display:block;
width: 240px;
height: 100%;
overflow:hidden;
/* background: grey; */
position:absolute;
z-index:1
}
#main_pane{
float:left;
height:100px;
left:0px;
overflow:hidden;
position:relative;
border:2px solid green;
background: url("panel-close-arrow.png") no-repeat scroll 2px 2px transparent ;
padding: 21px 10px;
right: 0;
text-indent: -99999px;
display:block;
width:350px;
}
HTML
<div id="left_pane">
<!--Content Here-->
</div>
<div id="main_pane">
<a class="toggle_right_pane" href="#">show/hide</a>
</div>