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 11-17-2012, 05:25 PM   PM User | #1
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 45
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
Shadowbox load on page load

Hello

I have followed the instructions and can't seem to get this working on ANY brower. I have checked through firebug to find any errors and there are none. If I tried to use a hyperlink to open the shadow box - doesn't work.


<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">
<script type="text/javascript" src="shadowbox/shadowbox.js"></script>
<script type="text/javascript">
window.onload = function() {

Shadowbox.init({
player: ['HTML']
});


Shadowbox.open({
content: 'images/Sympathy-card.jpg',
player: "html",
title: "Monsignor Raymond Hanna"

});

};
</script>
chellert is offline   Reply With Quote
Old 11-17-2012, 06:18 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,037
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Are you sure you have spelled shadowbox correctly in your script? Javascript is case-sensitive.



Quizmaster: Which king lost an eye at the Battle of Hastings in 1066?
Contestant: Was it Nelson?
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 11-17-2012, 06:26 PM   PM User | #3
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 45
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
Yep, everything is in lowercase. double and triple checked
chellert is offline   Reply With Quote
Old 11-17-2012, 07:18 PM   PM User | #4
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
try changin

Code:
player: ['HTML']
to

Code:
player: 'html'
thats the only thing I don't see done the same way on http://www.shadowbox-js.com/usage.html

also i think your images have to haev the rel='shadowbox" attribute so you could check for that as well

alos did you chec k the net tab in firebug to make sure it's fetching the image images/Sympathy-card.jpg ? maybe it should be /images ?

also content: looks to be literal content, so maybe

Code:
'images/Sympathy-card.jpg'

should be :

Code:
'<img src="images/Sympathy-card.jpg" />'
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users

Last edited by DanInMa; 11-17-2012 at 07:23 PM..
DanInMa is offline   Reply With Quote
Old 11-17-2012, 07:18 PM   PM User | #5
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
Have you added rel="shadowbox" to your links and specified a height and width for non-image links?
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Old 11-17-2012, 07:33 PM   PM User | #6
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 45
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
I have set the parameters, unset the parameters, played with settings and the rel='shadowbox' doesn't work either.

I followed the code the way the site states but still doesn't work
chellert is offline   Reply With Quote
Old 11-17-2012, 07:38 PM   PM User | #7
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 45
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
if I try to do a click function and have the shadowbox appear - still doesn't work. I have checked the location of the files, spelling, etc
chellert is offline   Reply With Quote
Old 11-17-2012, 07:43 PM   PM User | #8
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,037
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by chellert View Post
Yep, everything is in lowercase. double and triple checked
Well, it is obviously not.

Shadowbox.init({
player: ['HTML']
});

Shadowbox.open({
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 11-17-2012, 07:51 PM   PM User | #9
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 45
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
changed the letter S from capital to lower and back, still doesn't work
chellert is offline   Reply With Quote
Old 11-17-2012, 11:20 PM   PM User | #10
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
"Shadowbox" is correct per the document page http://www.shadowbox-js.com/usage.html
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 11-18-2012, 09:49 PM   PM User | #11
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 45
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
Thanks everyone, I gave up on this - can't figure it out and decided to go another route. Thanks for your posts
chellert is offline   Reply With Quote
Reply

Bookmarks

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 10:59 AM.


Advertisement
Log in to turn off these ads.