ThemeShaper Forums » Thematic

jQuery question

(2 posts)
  • Started 12 years ago by jackpatterson
  • Latest reply from jackpatterson
  • This topic is not resolved
  1. I am using Executable PHP plugin in order to make a random picture gallery in the left sidebar. I have a variable in php which determines how many pictures are loaded.

    my jquery script looks like this:

    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>

    <script type="text/javascript">
    var mainH = $("#main").height();
    var sideH = $("#sidebar-navigation").height();
    var length = Math.ceil((mainH-sideH)/300);


    How can I send that length variable to the following php?

    All the best,

    Jack Patterson

    Posted 12 years ago #
  2. Hello, I have since realised I'm being a bit of an idiot.

    Can anyone help me implement the following php in javascript (jQuery)?

    $families = array
    $numbers = range(0, $length);
    for($n = 0; $n<$length; $n++) {
    $random_1 = $numbers[$n];
    $random_1_tit = $families[ICL_LANGUAGE_CODE][$numbers[$n]];
            echo "<a href=\"". ICL_LANGUAGE_CODE ."/archives/" . $random_1 . ".jpg\" title= ". $random_1_tit. " class=\"thickbox\" /><img src=\"" . $random_1 . "_t.jpg\"  alt=\"\"/></a>";
    Posted 12 years ago #

RSS feed for this topic


You must log in to post.