2013-03-13 5 views
-2

"요청한 콘텐츠를로드 할 수 없습니다. 나중에 다시 시도하십시오."라는 메시지가 나타납니다. 무엇이 잘못되었는지 알 수 없습니다. 헤더에서Submit fancybox does not work

<form action="<?php echo site_url('frontend/accelerator/|fltru:true|');?>" method="post" name="product_form" > 
<input type="text" name="cod_bar" id="cod_bar" value="introduceti codul de bare" onClick="if (document.product_form.cod_bar.value == 'introduceti codul de bare') {document.product_form.cod_bar.value='';}" onBlur="if (document.product_form.cod_bar.value == '') {document.product_form.cod_bar.value='introduceti codul de bare';}"> 
<input type="text" value="introduceti cantitatea" name="qty" onClick="if (document.product_form.qty.value == 'introduceti cantitatea') {document.product_form.qty.value='';}" onBlur="if (document.product_form.qty.value == '') {document.product_form.qty.value='introduceti cantitatea';}"> 
<input type="submit" value="Insereaza" name="add_product" style="margin-left:5px; min-width:10px;"> 
<input type="submit" value="Cauta" **class="fancybox fancybox.button"** name="search_product" style="margin-left:5px; min-width:10px;"> 

</form> 

나는 이런 식으로 뭔가를 가지고 :

$(document).ready(function() { 
$(".fancybox").fancybox({ 
    width  : 700, 
    'height' : 500, 
    fitToView : true, 
    closeBtn : true, 
    autoSize : false, 
    closeClick : true, 
    openEffect : 'elastic', 
    closeEffect : 'elastic', 
    'type': 'iframe', 
    helpers : { 
    overlay : { 
    closeClick : true, 
     css : { 
      'background' : 'rgba(58, 42, 45, 0.3)' 
     } 
    } 
} 
}); 


}); 

나는이 같은 링크는 사실을 추가 싶어 : <a class="fancybox fancybox.button" href="something">bla</a>는, fancybox가 properly.Thanks를 작동합니다!

+0

"사실을 추가하고 싶습니다"? 미안, 네가 무엇을 묻고 있는지 정말로 모르겠다. –

+0

어쩌면 그는 사실 대신에 fancybox를 의미했을 것입니다. 질문 제목과 첫 번째 문장으로 충분하다고 말하면됩니다. – Christophe

답변

0

대신 버튼을 제출에 u는 fancybox 효과를 사용하려는 경우 .

<a href=''></a> 

그런 다음 제출 버튼에 onclick 이벤트를 포함시킨 다음 호출하십시오. 귀하의 경우 클릭 후 fancybox에로드 할 위치 나 이미지를 제공하지 않으므로 fancybox에로드하고 표시해야하는 컨텐츠도 제공해야합니다.

0

Fancybox는 리소스를로드하기 위해 href 속성을 찾습니다. 제출 조치에 이러한 속성이 없습니다. 나는 당신이 그것을 폼 액션 URL을로드하게하고 싶습니까? POST 데이터가 있습니까? http://fancyapps.com/fancybox/#docs

타고을 통해 당신이 할 수있는 A HREF 변수가 : 여기 보면 당신은을 통해 fancybox의 beforeLoad 방법을

$(".fancybox") 
    .attr('rel', 'gallery') 
    .fancybox({ 
     type: 'iframe', 
     autoSize : false, 
     beforeLoad : function() {      
      this.width = parseInt(this.href.match(/width=[0-9]+/i)[0].replace('width=','')); 
      this.height = parseInt(this.href.match(/height=[0-9]+/i)[0].replace('height=','')); 
     } 
}); 

http://jsfiddle.net/BJNYr/

를 타고해야합니다.

fancybox에 정확히 표시 할 내용을 결정하면됩니다.