$('#mask').css({'width':maskWidth,'height':maskHeight});

 

구글링을 통해 레이어로 띄우는 것을 구현해 보려고 하는데 위 문구가 에러를 일으킵니다.

 

xe의 글읽는 곳에 넣었습니다.

 

 

  • ?
    오류메시지가 없네요... 오류메시지도 볼 수 있으면 좋을텐데요.

    + 참고로 XE의 경우... 이미 적용하셨을 듯 합니다만...

    (function($){
    $('#mask').css({'width':maskWidth,'height':maskHeight});
    })(jQuery);

    로 사용하셔야 합니다.
  • ? profile
    Fatal Error: syntax error, unexpected ':', expecting ',' or ';

    $ -> jQuery 로 모두 교체했습니다.
  • profile ?

    XE템플릿이랑 충돌한 문제네요.

    jQuery('#mask').css({'width':maskWidth,'height':maskHeight});

    jQuery('#mask').css({ 'width':maskWidth,'height':maskHeight });
    로..!

  • ? profile
    오오 공백이 있어야 통과되는 거였군요. 저는 그동안 중괄호 다음에 그냥 행갈이를 해서 됐었는데 그게 그런 사정 때문이었나봐요.
  • profile
    jQuery('#mask').css({'width':maskWidth,'height':maskHeight});
    이렇게 하면 될려나요?

    css를 2개로 나누는 것도...

    $('#mask').css({'width':maskWidth});
    $('#mask').css({'height':maskHeight});
  • profile
    maskWidth랑 maskHeight는 위쪽에서 값이 들어가 있는 거죠?
  • profile profile
    https://www.jqueryscript.net/lightbox/Simple-jQuery-Plugin-For-Opening-A-Popup-Window-On-Page-load.html
    위 예제로 테스트를 해보고 제가 사용할 것으로 적용해보려는데 에러가 나서요.
  • profile
    jQuery('#mask').css('width', maskWidth);
    jQuery('#mask').css('width', maskHeight);

    이렇게 써보세요.
  • profile profile
    감사합니다. 에러는 없이 동작하게 되었습니다. css가 좀 이상하게 적용되는 부분이 있는 듯 해서 더 살펴봐야 겠네요.
  • profile profile
    위쪽 에러 메시지가 콜론이 문제가 있으니 콤마를 이용하라는 메시지 같았어요.

    괄호안에 들어간 중괄호는 일종의 배열처럼 이용할때 쓰는 건데 거기에 쓰인 콜론이 xe의 문법과 충돌하거나 php의 if문 같은 것에 사용하는 문법(if else로 안쓰고 if : 이렇게 쓰는...)과 충돌한것 같아요.
  • profile profile
    저도 충돌 가능성에 한 표 던집니다. 가끔 오류 뜰 때가 있더라구요ㅜ