Nope. Can't make that work either. I now have:
$(document).ready(function(){
$("a").fadeTo(500,0.33);
$("a").hover(function(){
$(this).fadeTo(500,1);
}, function() {
$(this).fadeTo(300,0.33);
});
$("#content").fadeTo(10,0.5);
$("a").click (function(event) {
event.preventDefault();
$("#content").slideUp('slow', function () {
$.post('http://uf.ekdahlproduction.com/itsvintage/text.php',
{site: $(this).attr('rel')}, function(data) {
$("#content").html(data);
$("#content").slideDown('slow');
});
});
});
});
And it's not actually cross-domain, it's just the way I wrote it for
some reason ^^
On 9 Nov, 02:51, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> surprised that the $.post is working since it looks like you're trying
> to do a cross-domain request, but anyway, the problem could be that
> you don't have a return false or preventdefault() anywhere. Try this:
>
> $("a").click (function(event) {
> event.preventDefault();
>
> // rest of your code ...
>
> --Karl
>
> ____________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Nov 8, 2008, at 8:47 PM, Althalos wrote:
>
>
>
> > Hi. I am trying to make a div slide up, update through $.post and then
> > slide down again. I have the following code:
> > $("a").click (function() {
> > $("#content").slideUp('slow', function () {
> > $.post('http://uf.ekdahlproduction.com/itsvintage/text.php',
> > {site: $(this).attr('rel')}, function(data) {
> > $("#content").html(data);
> > $("#content").slideDown('slow');
> > });
> > });
> > });
>
> > However, the div just goes up and down without any content on it. Can
> > anyone help me sort this out?
>
> > (I know the post thingy is working, because it works if I write the
> > $.post and its callback outside the callback function of slideUp.
> > Then, however, it will be possible to see the new content when it's
> > still on its way up)
>
> > thank you