1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Inserting line break in script

Discussion in 'Off Topic' started by Renada, May 16, 2011.

  1. Renada

    Renada Active Member

    Hi,

    Not sure if this is the right section for this but I know Brogan will move me if not :)

    I have a slideshow module that I'd like to use on my front page (using Jaxel's portal). It's very basic, just a line of images that link to specific messages or forums. What I'd like to do is put a line of text under each image but everything I try results in breaking the script.

    This is one line of the code:

    Code:
    leftrightslide[0]='<a href="http://"><img src="http://www.xxxxx.com/community/forums/images/health.jpg" width="160" height="160" border="0">INSERT TEXT HERE</a>'  OR HERE
    
    
    Is this possible or do I need to find something else?

    Thanks,
    Renada :)
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    As this isn't really XenForo related, I'm afraid it doesn't really fit in general support.

    What you're trying to do will require some additional HTML and CSS but it's difficult to say without seeing the script in its entirety, or how it currently outputs.
     
  3. Lawrence

    Lawrence Well-Known Member

    As Brogan stated we would need to see the script to be sure. The line of php you posted is missing the ";" at the end though.

    Try this:

    Code:
    leftrightslide[0] = '<a href="http://"><img src="http://www.xxxxx.com/community/forums/images/health.jpg" width="160" height="160" border="0"><br />INSERT TEXT HERE</a>';
    
    
     
  4. Renada

    Renada Active Member

    Hi,

    I'm using this script - http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm from DynamicDrive. The code doesn't have that ; at the end of the lines though.

    Thanks again :)

    Renada
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    It's using a table layout so you could rewrite the script to add another row below the images for the text.
     
  6. Renada

    Renada Active Member

    Rewrite the script???? <falls off chair> Ok I've recoverd now lol. Could you please tell me where and how I start? I'm very good at farkling things on my own but not good at making things work :)

    Regards,
    Renada
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Well I only had a quick look at it but essentially you would need to add another <tr> row with a set of <td> elements to contain the text.
     
  8. Wuebit

    Wuebit Well-Known Member

    PHP:
    leftrightslide[0]='<a href="http://"><img src="dynamicbook1.gif" border=1><br />blah</a>'
     
  9. Lawrence

    Lawrence Well-Known Member

    Ahh, JS, :p

    You can't add anything to that script that will cause a line break as the positioning is thrown off for the rest of the images.

    I'll take a look for you, though. :)
     
  10. Wuebit

    Wuebit Well-Known Member

    I tested the above and it worked fine Lawrence (I also see you posted the same before me, I didn't see that till now. Was all in a template tho)
     
  11. Lawrence

    Lawrence Well-Known Member

    hmmm, I tried the break in mine and it left one image above the rest (I used 5 images).

    Though I do have a working solution, that is not pretty, lol.

    I'll post it here if the <br /> doesn't work for Renada
     
    Vodkaholic likes this.
  12. Renada

    Renada Active Member

    That's exactly what's happening. Thanks for offering to take a look :)

    Renada
     
  13. Lawrence

    Lawrence Well-Known Member

    I can get it to do what you want, but there is a large gap between the images. Unacceptable.

    I'm trying a few more ideas.
     
  14. Renada

    Renada Active Member

    Thanks very much Lawrence :)
     
  15. Lawrence

    Lawrence Well-Known Member

    Don't thank me quite yet. I have it working correctly in Firefox, but not IE. IE handles the positioning and floats differently than FF.

    The script is pretty old. I would recommend finding another one, and in the mean time to not use text in this one.

    I'll play with it a bit more tomorrow.
     
  16. Renada

    Renada Active Member

    Thanks Lawrence :) I know it's an old script but I've not been able to find another one that works in this "conveyor belt" fashion.

    I'll have another look around the web while I wait to see if you can beat this one into submission :)

    Renada
     
  17. Renada

    Renada Active Member

    Hi Lawrence,

    I think I have it working now. I found a slightly altered version of that script and I think it's going to do what I want. I'll let you know :)

    Thanks to you,Vodka and Brogan for trying to help :)

    Regards,
    Renada :)
     

Share This Page