我想用jScrollPane程序设置一个div,但问题是div在一个信息框内,首先需要在div设置样式之前进行初始化。我怎样才能做到这一点?
var infoBox1Settings = {
content: boxText
,disableAutoPan: false
,alignBottom: true
,maxWidth: 0
,pixelOffset: new google.maps.Size(-142, -28)
,zIndex: null
,closeBoxMargin: ''
,closeBoxURL: ''
,infoBoxClearance: new google.maps.Size(1, 1)
,isHidden: false
,pane: 'floatPane'
,enableEventPropagation: false
};
infowindowVenue = new InfoBox(infoBox1Settings);
infowindowVenue.open(map, markersHash['markerVenue'+data.id]);
var searchElement = $(".venue-prof").jScrollPane({showArrows: true});
searchApi = searchElement.data('jsp');
答案 0 :(得分:2)
观察信息框的domready-event并在它发生时应用jScrollPane:
google.maps.event.addListener(infowindowVenue ,'domready',function(){
$('.venue-prof',this.div_).jScrollPane({showArrows: true});
});