Why is firebug pointing out an error with my code?
-
04-07-2021 - |
Question
Could someone please tell me why firefox doesn't like this section of code?
function TB_position(){
$('TB_window').set('morph', {
duration: 75
});
$('TB_window').morph({
width: TB_WIDTH + 'px',
left: (window.getScrollLeft() + (window.getWidth() - TB_WIDTH) / 2) + 'px',
top: (window.getScrollTop() + (window.getHeight() - TB_HEIGHT) / 2) + 'px'
});}
Theres got to be something small missing like a bracket or period or something that I'm missing. Thanks!
**I SOLVED MY OWN PROBLEM! one of my scripts was competing with the other. Thanks anyway!
No correct solution
OTHER TIPS
Looks like you're missing closing );}
... but, without more code its hard to tell whats going on here.
function TB_position(){
$('TB_window').set('morph', {
duration: 75
});
$('TB_window').morph({
width: TB_WIDTH + 'px',
left: (window.getScrollLeft() + (window.getWidth() - TB_WIDTH) / 2) + 'px',
top: (window.getScrollTop() + (window.getHeight() - TB_HEIGHT) / 2) + 'px'
} //missing paranthesis here ");"
You are missing the closing parenthesis on the morph()
call:
$('TB_window').morph({
...
}
Should be:
$('TB_window').morph({
...
});
function TB_position(){
$('TB_window').set('morph', {
duration: 75
});
$('TB_window').morph({
width: TB_WIDTH + 'px',
left: (window.getScrollLeft() + (window.getWidth() - TB_WIDTH) / 2) + 'px',
top: (window.getScrollTop() + (window.getHeight() - TB_HEIGHT) / 2) + 'px'
}); // missing );
} // missing end to function TB_position
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow