Do you have an online example so I can get a better picture of just what
you are trying to do?
Dave Maharaj :: WidePixels.com wrote:
Yes I have.
Might be dumb of me but I will ask.
Originally the <script type="text/javascript">
....
</script>
and the needed js files were on the page specifically needing it.
But now that I am loading that page into one... Where do the scripts and
files go?
Do they now go to the page that they will be loaded into or do they stay on
their own original page?
Page 1
------------
page1.js
<script type="text/javascript">
....
</script>
Page 2
------------
page2.js
<script type="text/javascript">
....
</script>
Since Page 2 is going to be loaded into page 1 DIV do I move the page2
scripts to page 1?
Dave
-----Original Message-----
From: Liam Potter [mailto:radioactiv...@gmail.com]
Sent: August-04-09 1:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Newbie Question
Have you updated the original script to my one?
<script type="text/javascript">
function _ajaxInit() {
$("a.group").fancybox(
{
'overlayShow': true
});
});
window.onload = function () {
$('.sliderGallery').each(function(){
var id_parts = $(this).attr('id').split('_');
var id = id_parts[id_parts.length - 1];
var container = $('#sliderGallery_' + id) ;
var ul = $('ul', container);
var itemsWidth = ul.innerWidth() - container.outerWidth();
$('.slider', container).slider({
min: 0,
max: itemsWidth,
handle: '.handle',
stop: function (event, ui) {
ul.animate({'left' : ui.value * -1}, 500);
},
slide: function (event, ui) {
ul.css('left', ui.value * -1);
}
});
});
}
</script>
Dave Maharaj :: WidePixels.com wrote:
3 Errors
syntax error
[Break on this error] });\n
(line 167)
syntax error
[Break on this error] });\n
(line 6)
_ajaxInit is not defined
[Break on this error] _ajaxInit();\n
That's what I see now but still nothing good happening.
dave
-----Original Message-----
From: Liam Potter [mailto:radioactiv...@gmail.com]
Sent: August-04-09 1:19 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Newbie Question
yeah, use the modified script and add _ajaxInit(); to the callback;
$('a.profile_data').click(function(){
var url = $(this).attr('href');
//alert(url);
$('#loadHere').fadeOut('fast', function(){
$('#loadHere').load(url, function(){
$('#loadHere').fadeIn('fast');
_ajaxInit();
});
});
return false;
});
Dave Maharaj :: WidePixels.com wrote:
Nope...no go.
All I have for the "tabs" are just straight links calling the script
to load the page.
$('a.profile_data').click(function(){
var url = $(this).attr('href');
//alert(url);
$('#loadHere').fadeOut('fast', function(){
$('#loadHere').load(url, function(){
$('#loadHere').fadeIn('fast');
});
});
return false;
});
Dave
-----Original Message-----
From: Liam Potter [mailto:radioactiv...@gmail.com]
Sent: August-04-09 12:50 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Newbie Question
<script type="text/javascript">
function _ajaxInit() {
$("a.group").fancybox(
{
'overlayShow': true
});
});
window.onload = function () {
$('.sliderGallery').each(function(){
var id_parts = $(this).attr('id').split('_');
var id = id_parts[id_parts.length - 1];
var container = $('#sliderGallery_' + id) ;
var ul = $('ul', container);
var itemsWidth = ul.innerWidth() -
container.outerWidth();
$('.slider', container).slider({
min: 0,
max: itemsWidth,
handle: '.handle',
stop: function (event, ui) {
ul.animate({'left' : ui.value * -1}, 500);
},
slide: function (event, ui) {
ul.css('left', ui.value * -1);
}
});
});
}
_ajaxInit();
</script>
if that doesn't work, call _ajaxInit() on the tabs callback function
Dave Maharaj :: WidePixels.com wrote:
I have a standard php page with some jquery going on its working fine.
Now I want to take that page and load it into a div on a different
page (tabbed layout pretty much) but when I do the script no longer
works when the page loads into the div.
SCRIPT CURRENTLY ON THE PHP PAGE THAT WORKS WHEN VIEWED DIRECTLY IN
BROWSER
<script type="text/javascript">
$(document).ready(function() {
$("a.group").fancybox(
{
'overlayShow': true
});
});
window.onload = function () {
$('.sliderGallery').each(function(){
var id_parts = $(this).attr('id').split('_');
var id = id_parts[id_parts.length - 1];
var container = $('#sliderGallery_' + id) ;
var ul = $('ul', container);
var itemsWidth = ul.innerWidth() -
container.outerWidth();
$('.slider', container).slider({
min: 0,
max: itemsWidth,
handle: '.handle',
stop: function (event, ui) {
ul.animate({'left' : ui.value * -1}, 500);
},
slide: function (event, ui) {
ul.css('left', ui.value * -1);
}
});
});
}
</script>
How can I get it to still work when loaded into the DIV?
Thanks
Dave