Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <--!this goes in script-->
- <script type="text/javascript"
- src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
- <script>
- $(document).ready(function() {
- //
- $('a.poplight[href^=#]').click(function() {
- var popID = $(this).attr('rel'); //Get Popup Name
- var popURL = $(this).attr('href'); //Get Popup href to define size
- var query= popURL.split('?');
- var dim= query[1].split('&');
- var popWidth = dim[0].split('=')[1]; //Gets the first query string value
- $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"></a>');
- var popMargTop = ($('#' + popID).height() + 80) / 2;
- var popMargLeft = ($('#' + popID).width() + 80) / 2;
- //Apply Margin to Popup
- $('#' + popID).css({
- 'margin-top' : -popMargTop,
- 'margin-left' : -popMargLeft
- });
- $('body').append('<div id="fade"></div>');
- $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'})
- return false;
- });
- $('a.close, #fade').live('click', function() {
- $('#fade , .popup_block').fadeOut(function() {
- $('#fade, a.close').remove(); //fade them both out
- });
- return false;
- });
- });
- </script>
- <--!this is my css-->
- <!--the background fade-->
- #fade {
- display: none;
- background-color: #000;
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- opacity: .5;
- z-index: 9999;
- }
- <!--the box itself-->
- .popup_block{
- display: none;
- padding: 20px;
- position: fixed;
- top: 50%;
- left: 50%;
- background-color: #e2d7d0;
- z-index: 99999;
- outline: 3px solid {Color:Borders};
- box-shadow: 2px 2px 10px #000;
- }
- img.btn_close {
- float: right;
- margin: -55px -55px 0 0;
- }
- *html #fade {
- position: absolute;
- }
- *html .popup_block {
- position: absolute;
- }
- <!--the html link codes-->
- <a href="#?w=500(your width)" rel="pop1(name of pop)" class="poplight" title="{text:pop1 title}">✦</a>
- <!--the pop up itself, this goes last right before the body and html end code for me-->
- <div id="pop1" class="popup_block">
- Sesame snaps cotton candy cake donut cake tiramisu danish. Gummi bears biscuit brownie soufflé dessert dragée. Chupa chups dragée jelly. Fruitcake powder caramels lemon drops wafer. Jelly-o dessert icing gummi bears tiramisu gummi bears sweet wafer muffin. Carrot cake sweet marshmallow gummi bears biscuit marzipan jelly. Topping soufflé lemon drops jujubes biscuit tart. Chocolate gummies jujubes lemon drops muffin lemon drops halvah dessert.
- Sesame snaps cotton candy cake donut cake tiramisu danish. Gummi bears biscuit brownie soufflé dessert dragée. Chupa chups dragée jelly. Fruitcake powder caramels lemon drops wafer. Jelly-o dessert icing gummi bears tiramisu gummi bears sweet wafer muffin. Carrot cake sweet marshmallow gummi bears biscuit marzipan jelly. Topping soufflé lemon drops jujubes biscuit tart. Chocolate gummies jujubes lemon drops muffin lemon drops halvah dessert.
- </div>
- </div>
Add Comment
Please, Sign In to add comment