1

I am using http://github.com/voronianski/jquery.avgrund.js/

my js call is:

$('.reserve_button').avgrund({ enableStackAnimation: false, onBlurContainer: '.content', holderClass: 'custom', template: $(".rezerve-modal").html() });

and my popup content is:

<div class="avgrund-overlay"></div>
<div class="rezerve-modal">
    <div style="background-color: #CEEEF2; padding: 5px 10px; height: 100%;">
        some content
        <span class="modal-btn hoverU cancel">Cancel</span>
    </div>
</div>

What I want is, when I click cancel I want popup to be closed.

John Slegers
  • 45,213
  • 22
  • 199
  • 169
hakan
  • 3,284
  • 2
  • 19
  • 25

2 Answers2

2

You have got different attributes for that:

showClose: false, // switch to 'true' for enabling close button
showCloseText: '', // type your text for close button
closeByEscape: true, // enables closing popup by 'Esc'..
closeByDocument: true, // ..and by clicking document itself
GMZ
  • 334
  • 1
  • 10
  • I didnt get what you mean... values you wrote for those attributes are same as default values of those attributes which you can see from here https://github.com/voronianski/jquery.avgrund.js/blob/master/js/jquery.avgrund.js What is your suggestion? – hakan May 23 '13 at 10:00
  • yes i've set de default values but you can set the showClose attribute on true and the showCloseText on cancel. then you will have a button with the text cancle which close the avground – GMZ May 23 '13 at 10:44
  • yes indeed its working. but I cant position or style this default button. Is there a way to do it? why cant I call activate/deactivate functions which already exist? – hakan May 23 '13 at 11:01
  • ah sorry i've understood your question wrong you can call a method with this Avgrund.hide(); that should work – GMZ May 23 '13 at 11:08
  • such function doesnt exist. – hakan May 23 '13 at 11:49
  • http://lab.hakim.se/avgrund/ --> he made it with Avground.show() and .hide() and it works fine – GMZ May 23 '13 at 12:04
  • its obvious that I am not using hakim's library. – hakan May 23 '13 at 13:18
2

I fixed this by adding avgrund-close class to element I want to use for close. there is nothing else to be done.

<span class="modal-btn hoverU avgrund-close cancel">İptal</span>

after small modifications on css classes I achieved my goal.

hakan
  • 3,284
  • 2
  • 19
  • 25