2

I have this site I've been working on here: http://www.replyonline.co.uk/DirectionGroup/xmas/index.php

When you hover over the first photo at the top, a voting box appears. Now if you click on the photo it displays the 'By whom' name and 2 numbers (the vote results). Both the photo thumbnail and the enlarged lightbox share the same HTML content as each other.

What I don't understand is why the enlarged box doesn't display the HTML properly, just the 2 numbers from the voting element rather than the voting element itself.

If you look at the source, you can see down the page in the code is the javascript and I can't figure out what I need to change to the JS in order to make HTML display on the larger view?

Here is an example of what the markup is for each thumbnail you click:

<a href="#"><img src="images/thumbs/1.jpg" data-largesrc="images/large/1.jpg" alt="image01"/><span>By Tim Morgan <?php echo ThumbsUp::item('1')->template('thumbs_up_down') ?></span></a>

As you can see, there is the thumb source and the large source as well as the voting function.

6
  • You seem to use .text to copy the name/votes. What about using .html? Commented Nov 8, 2011 at 12:46
  • Just tried changing to .html. Now if you look, it actually shows the HTML as text :/ Commented Nov 8, 2011 at 12:52
  • I mean setting with .html as well ;) Commented Nov 8, 2011 at 12:52
  • Think it may have worked. Have another look at the same URL. Seems a bit intermittent though, sometimes shows, sometimes doesn't. Commented Nov 8, 2011 at 12:54
  • It seems .tmpl doesn't accept HTML. Could you try removing the else clause on line 371? I think the HTML is then always set. Commented Nov 8, 2011 at 13:01

2 Answers 2

1

It turns out you have to set HTML with the .html method - currently you're converting the whole to text and then setting text.

Secondly, it looks like .tmpl does not like HTML. If you also set the HTML the first time (when doing .tmpl), it should always work.

Sign up to request clarification or add additional context in comments.

Comments

1

It may help to clone() the forms so they exist on the previews.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.