0
$(document).ready(function(){
 $('#slider-comingsoon').bxSlider({
  mode: 'fade',
  pagerCustom: '#slider-comingsoon-pager',
  nextSelector: '#slider-comingsoon-next',
  nextText: '<img src="../images/box-rightarrow-hd.png" height="34px" width="27px" onmouseover="this.src='../images/box-rightarrow-hd-rollover.png';" onmouseout="this.src='../images/box-rightarrow-hd.png';" />'
 });
});

如何正确转义以下行以使其正常工作?

  nextText: '<img src="../images/box-rightarrow-hd.png" height="34px" width="27px" onmouseover="this.src='../images/box-rightarrow-hd-rollover.png';" onmouseout="this.src='../images/box-rightarrow-hd.png';" />'
4

1 回答 1

2

使用\'代替'

nextText: '<img src="../images/box-rightarrow-hd.png" height="34px" width="27px" onmouseover="this.src=\'../images/box-rightarrow-hd-rollover.png\';" onmouseout="this.src=\'../images/box-rightarrow-hd.png\';" />'
于 2013-11-14T00:31:18.873 回答