SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help for text replacing

    I have a pitures folder with this format :

    name_setnumber_picnumber.jpg

    for ex: foo_1_02.jpg

    Please help me to find how to write a function in JS to return the next and prev image names of the given name of the first image. ( foo_1_01.jpg and foo_1_03.jpg )

    Thanks in advance .

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    erm i dont know what the hell you meant by that, but it's late for me so just try this

    PHP Code:
    <img name="blah" src="http://i.sitepoint.com/fi/top_logo_sitepoint.gif" onclick="this.src='http://i.sitepoint.com/fi/buildOff.gif';"

  3. #3
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok , i have a folder have these picture

    foo_1_01.jpg
    foo_1_02.jpg
    foo_1_03.jpg

    in one html I have this code <a href="javascript:FullImage2('foo_1_02.jpg')"> i wanna ask that how can I write script to calculate, replace ,... whatever to get names of the previous (01) and next (03) image . to make the NAVIGATION

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't think properly right now as its too late, but i had a go any way.

    PHP Code:
    <script>

    var 
    img = new Array();

    img[0]    = 'http://i.sitepoint.com/fi/buildOff.gif'  ;
    img[1]    = 'http://i.sitepoint.com/fi/profitOff.gif'  ;
    img[2]    = 'http://i.sitepoint.com/fi/promoteOff.gif'  ;

    a=0;

    function 
    next()
    {
        
        if     (
    img.length)     {a++;i.src=img[a];}
        else                {
    i.src=img[0];}
    }

    </script>
    <img name="i" src="http://i.sitepoint.com/fi/top_logo_sitepoint.gif">
    <a href="javascript:next()">next</a> 
    that should get you going

  5. #5
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so sad that I made you misunderstood and waste time for this but please let's see again .

    okie , I have a parent window that have a link :

    Code:
    <a href="fullImage('foo_1_02.jpg')"><img src="tn_foo_1_02.gif"></a>
    fullImage func will make a pop up that load the image given (foo_1_02.jpg) .

    And I wanna find how to rewrite my fullImage script to write the link to prev and next images (all images are named in the same format (foo_1_xx.jpg) . So I think I wanna know how to extract , replace or some actions to extract the number 02 from this example and +1 , -1 and write 2 link lines to the image foo_1_01 and foo_1_03 just below the image foo_1_02.jpg in the popup

    hope this's last time I take ur time .

    THank you


Bookmarks

Posting Permissions

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