Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Thanked 0 Times in 0 Posts

    passing var to hidden div with href

    Hi all. A bit of a complicated one to explain (but is hopefully easy to solve :/)

    I am designing a members website - call it a facebook clone, but it has different goals.

    I have two main visible divs - one with the users photo, the other with a searched members photo from a db.

    Clicking on a member will bring up profile information that is retrieved from the db.

    As a seperate script, using href="seemember.php?id=1234" with a $_get already works.

    The problem - Instead of using a different php page, I have a hidden div being called using colorbox/.

    The line calling currently looks like this:
    <a class="profilecb" href="#"> <img src="<?php echo $dprofilepicture ?>" ></a>
    This currently works great for displaying one profile, but ideally it need to be
    <a class="profilecb" href="#?id=1234"> <img src="<?php echo $dprofilepicture ?>" ></a>
    similar, in fact, to facebook.

    However - I cannot get this var to the hidden div. (the div would then retrieve the relevant members db info and then display it)

    I have tried every way I can think of to do this, even trying to use "include" within the div to see if I could uses an outside php script instead - all to no avail.

    I believe the issue is with colorbox as the class is not CSS but JS. The line being
    $(".profilecb").colorbox({width:"50%", height:"90%", inline:true, href:"#profile_cbox"});
    Hopefully this makes sense, have been battling this for two days and my brain has fried...lol.

    Any ideas on how to do this?

  2. #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Thanked 330 Times in 326 Posts
    Sounds like you're looking for AJAX functionality. You should be able to Google up thousands of tutorials quite easily. If you're using a javascript framework, check out their wrappers. If not, look at Jquery.
    Are you a Help Vampire?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts