Obtener Javascript para mostrar HTML en una ventana emergente

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.

preguntado el 08 de noviembre de 11 a las 12:11

You seem to use .text to copy the name/votes. What about using .html? -

Just tried changing to .html. Now if you look, it actually shows the HTML as text :/ -

I mean setting with .html también ;) -

Think it may have worked. Have another look at the same URL. Seems a bit intermittent though, sometimes shows, sometimes doesn't. -

Parece .tmpl doesn't accept HTML. Could you try removing the else clause on line 371? I think the HTML is then always set. -

2 Respuestas

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.

respondido 08 nov., 11:17

Puede ayudar clone() the forms so they exist on the previews.

Respondido el 25 de diciembre de 11 a las 00:12

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.