0
我需要幫助來解決我遇到的問題。我需要一個彈出窗口來顯示一個條件的信息。我成功實現它,但它需要點擊一個按鈕。我需要的是它出現在頁面加載後,如果它驗證一個條件。加載彈出式頁面加載時的一個條件/ BPOPUP插件
這裏是代碼,在此先感謝。
<?php
$set = 0;
if($this->dx_auth->is_logged_in())
{
$userid = $this->dx_auth->get_user_id();
if($list->user_id == $userid)
{
$set = 1;
}
}
?>
<?php if($set): ?>
<div id="new_hosting_actions">
<h2> <?php echo anchor ('rooms/edit/'.$room_id,translate("Edit this Listing")); ?> <span class="smaller"> <?php echo translate("Upload photos, change pricing, edit details"); ?> </span> </h2>
<hr class="toolbar_separator" />
<h2> <?php echo anchor ('calendar/single/'.$room_id,translate("Calendar")); ?><span class="smaller"> <?php echo translate("Change the availability of").' '.'"'.$title.'"'; ?> </span> </h2>
<hr class="toolbar_separator" />
<h2> <?php echo anchor('users/edit', translate("Update Your Profile"))?> <span class="smaller"> <?php echo translate("Upload a new profile image and change your profile");?> </span> </h2>
<script type="text/javascript">
;(function($) {
$(function() {
$('#my-button2').bind('click', function(e) {
e.preventDefault();
$('.element_to_pop_up2').bPopup({
closeClass:'close',
fadeSpeed: 'slow', //can be a string ('slow'/'fast') or int
followSpeed: 1500, //can be a string ('slow'/'fast') or int
modalColor: 'black',
contentContainer:'.content',
zIndex: 1,
modalClose: true
});
});
});
})(jQuery);
</script>
<button id="my-button2" type="button" class="button5">POP IT UP</button>
<div id="element_to_pop_up" class="element_to_pop_up2" style="display:none">
<div id="status">
<div id="dates" class="book_it_section" >
<input id="hosting_id" name="hosting_id" type="hidden" value="<?php echo $room_id; ?>" />
<h2>Send Message </h2>
<div class="messagearea">
</div>
<p><div class="border"></div></p>
<div class="send">
</div>
</div>
</div>
<a class="close" href="#"><img src="<?php echo base_url(); ?>images/fancy_close.png" alt="close" width="45" height="45" /> </a>
</div>