Fancybox Error automatic reload

╄→гoц情女王★ 提交于 2019-12-23 02:52:46

问题


i am a dummie with fancy box and i need help iwth this

i load a form with fancybox automatically when the principal page is load but the content is reload every time i click in a select or input

Thanks for your help.

<script type="text/javascript">
  $(document).ready(function() {
        $("#yt").fancybox(
        {
            closeBtn : false,
            closeClick  : false, fancybox 
  openEffect  : 'none',
  closeEffect : 'none',
  helpers   : { 
   overlay : {closeClick: false}  
  }
        }
    ).trigger('click');
    });
</script>

<form name="form1" action="">
        <ul>
            <li>
                <div>Number</div>
                <select id="number" name="number">
                    <option value="01">01</option>
                    <option value="02">02</option>
                    <option value="03">03</option>
                    <option value="04">04</option>
                    <option value="05">05</option>
                    <option value="06">06</option> 
                </select>
            </li>
        </ul>
</form>

PD: My english is not good!


回答1:


This is my solution if you need help

<script type="text/javascript">
  $(document).ready(function() {
        $.fancybox(
        {
            closeBtn : false,
            href: "#yt",
            closeClick  : false, // prevents closing when clicking INSIDE fancybox 
            openEffect  : 'none',
            closeEffect : 'none',
            keys  : {//close  : [27], // escape key
                close  : null, },
            helpers   : { 
               overlay : {closeClick: false} // prevents closing when clicking OUTSIDE fancybox 
              }
        }
    ).trigger('click');
    });
</script>


来源:https://stackoverflow.com/questions/20751950/fancybox-error-automatic-reload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!