2013-08-01 47 views
0

如何突破线路在此代码:我怎样才能打破行文字容器

if (imageTextContainer.length > 0) { 
    imageTextContainer.text(imageItem.text +imageItem.dec); 
} 

如何得到这样的结果:

imageItem.text </br> imageItem.dec 

我有这样的代码::

{ 
    image : "<?php bloginfo('template_directory'); ?>/pictures/1.jpg", 
    alt : "Picture 1", 
    dec : "rockstar games", 
    text : "Grand Theft Auto San Andres\r\n" 
} 

\r\n它不工作只回声空间

+0

欢迎堆栈溢出。您可以使用[代码示例'{}'](http://i.stack.imgur.com/VYd26.png)工具栏按钮来格式化源代码。这次我为你做了。 –

+0

对不起,我的英文是坏的 –

回答

1

试试这个:

if (imageTextContainer.length > 0) { 
    imageTextContainer.html(imageItem.text + '<br>' + imageItem.dec); 
} 
+1

非常感谢你的作品 –

-1
if (imageTextContainer.length > 0) { 
    imageTextContainer.html(imageItem.text + "<br />" +imageItem.dec); 
    }