Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-28-2008, 10:00 PM   PM User | #1
rcouser
New Coder

 
Join Date: Sep 2008
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
rcouser is an unknown quantity at this point
Exclamation reload page on closer of shadowbox

Hello,
I'm not to sure where the best place is to post this but I need help with JavaScript to reload page on closer of shadowbox.
http://www.mjijackson.com/shadowbox/
The problem is I have a button that when clicked loads up shadowbox with form inside to add products. When the form is submit and shadowbox closes I have to reload the page manually for the entries to appear. Is there some sort of code that could reload the page automatically on closure of the shadowbox. I notice is the shadowbox.js the follow line onClose:null, and thought maybe it could be something to do with this but my JavaScript skills are minimal.
Thanks in Advance.
rcouser is offline   Reply With Quote
Old 09-29-2008, 05:19 AM   PM User | #2
rangana
Senior Coder

 
rangana's Avatar
 
Join Date: Feb 2008
Location: Cebu City, Philippines
Posts: 1,752
Thanks: 65
Thanked 372 Times in 365 Posts
rangana will become famous soon enoughrangana will become famous soon enough
Go to shadowbox.js and find this part:
Code:
 Shadowbox.close = function(){
        if(!activated) return; // already closed

        // stop listening for keys
        listenKeys(false);
        // hide
        toggleVisible(false);
        // remove the content
        if(content){
            content.remove();
            content = null;
        }

        // clear slideshow variables
        if(typeof slide_timer == 'number') clearTimeout(slide_timer);
        slide_timer = null;
        slide_delay = 0;

        // fire onClose handler
        if(options.onClose && typeof options.onClose == 'function'){
            options.onClose(gallery[current]);
        }

        activated = false;
		location.reload();
    };
Add highlighted.
__________________
Learn how to javascript at 02geek

The more you learn, the more you'll realize there's much more to learn
Ray.ph
rangana is offline   Reply With Quote
Old 09-29-2008, 12:29 PM   PM User | #3
rcouser
New Coder

 
Join Date: Sep 2008
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
rcouser is an unknown quantity at this point
Thanks a lot rangana, just what I needed. Works a treat.
rcouser is offline   Reply With Quote
Old 10-16-2008, 08:37 AM   PM User | #4
I_Love_Privacy
Banned

 
Join Date: Aug 2007
Posts: 39
Thanks: 6
Thanked 0 Times in 0 Posts
I_Love_Privacy is an unknown quantity at this point
are there any way you can do this without updating the core shadowbox js?
I_Love_Privacy is offline   Reply With Quote
Old 10-16-2008, 10:04 AM   PM User | #5
rangana
Senior Coder

 
rangana's Avatar
 
Join Date: Feb 2008
Location: Cebu City, Philippines
Posts: 1,752
Thanks: 65
Thanked 372 Times in 365 Posts
rangana will become famous soon enoughrangana will become famous soon enough
I could'nt be of any certainty here, but try:
Code:
<script type="text/javascript">
function closeSelf()
{
var close=document.getElementById('shadowbox_nav_close'); // ID of the "x" image?
close.onclick=function()
	{
	Shadowbox.close();
	location.reload();
	}
}
window.addEventListener?window.addEventListener('load',closeSelf,false):
window.attachEvent('onload',closeSelf);
</script>
__________________
Learn how to javascript at 02geek

The more you learn, the more you'll realize there's much more to learn
Ray.ph
rangana is offline   Reply With Quote
Reply

Bookmarks

Tags
page reload, shadowbox

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:54 PM.


Advertisement
Log in to turn off these ads.