के शीर्ष पर JQuery स्क्रॉल मैं वर्तमान में एक वेबसाइट पर लंबे कानूनी संदेश प्रदर्शित करने के लिए बूटस्ट्रैप मोडल प्लगइन का उपयोग कर रहा हूं, लेकिन समस्या यह है कि यदि आप दूसरे के बाद एक मोडल खोलते हैं, तो दूसरा दूसरा होगा पहले से ही जो भी स्थिति थी, उसे पहले से स्क्रॉल किया जा सकता है। तो मैं जेएस/JQuery के साथ शीर्ष पर एक div स्क्रॉल करने के लिए एक रास्ता तलाश रहा हूँ। इस कोड को मैं वर्तमान में उपयोग कर रहा हूँ है:बूटस्ट्रैप मॉडल
HTML:
<!--MODAL-->
<div id="modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="modalTitle"></h3>
</div>
<div id="modal-content" class="modal-body">
</div>
<div class="modal-footer">
<button id="modalPrint" class="btn btn-info hidden-phone" onClick=''>Print</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
जावास्क्रिप्ट:
function openModal(heading, url) {
$.ajax({
url: url,
cache: false
}).done(function(html) {
$("#modal-content").html(html);
$("#modalTitle").html(heading);
$('#modalPrint').attr('onClick', 'loadPrintDocument(printCookies, {attr : "href", url : '+ url +', showMessage: false, message: "Please wait while we create your document"})');
$('#modal').modal('show');
$("#modal-content").scrollTop(0);
});
}
आप देख सकते हैं, मैं शीर्ष करने के लिए स्क्रॉल की कोशिश की है के बाद मॉडल किया गया है दिखाया गया है। कोई विचार?
एक इलाज करता है - धन्यवाद! –
बूटस्ट्रैप मोडल के साथ ठीक काम करता है। –
'hide' पर बजाय' shown' पर यह कर एक चिकनी प्रस्तुति –