简体   繁体   English

Extjs 4.2.2 - textarea中图像后面的可滚动文本

[英]Extjs 4.2.2 - scrollable text behind image in textarea

I'm searching high and low to achieve what has been done in this fiddle: http://jsfiddle.net/wNTe6/1/ 我正在寻找高低,以实现在这个小提琴中所做的事情: http//jsfiddle.net/wNTe6/1/

I need the same effect for an Extjs -Textarea. 我对Extjs -Textarea需要相同的效果。

(background-image seems to be outdated, I used an image-URL of a random-image) (背景图像似乎已经过时,我使用了随机图像的图像URL)

I need a teaxtarea with a (background?-) image (center/middle) and text. 我需要一个带有(背景? - )图像(中间/中间)和文本的teaxtarea。 The text should be scrollable, but has to disappear behind the image. 文本应该是可滚动的,但必须在图像后面消失。

At the very moment, text is scrolling above my background-image (which is understandable). 此刻,文本在我的背景图像上方滚动(这是可以理解的)。

My textarea (Extjs): 我的textarea(Extjs):

var txtField = Ext.create('Ext.form.field.TextArea', {
name: 'transitionTextArea',
width: transWidth,
height: 100,
border: false,
value: 'Transition Transition Transition Transition Transition Transition',
readOnly: true,
fieldCls: 'transition-style'
});

CSS-Class: CSS-类:

.transition-style {
background-image: url('../images/icons/processControl/transition_160x32.png');
background-repeat: no-repeat;
text-align: center;
vertical-align: middle;
border: 0px;
padding-top: 30px;
}

Can anyone please help me? 谁能帮帮我吗?

Any help would be highly appreciated! 任何帮助将非常感谢!

-nemesis- -nemesis-

Well, I'll give it a shot, but it's not very elegant. 好吧,我会试一试,但它不是很优雅。

Here is the Fiddle . 这是小提琴

Changes in HTML. HTML中的变化。

<div class='imgdiv'>
    <img src='http://minionslovebananas.com/images/check-in-minion.jpg' width='100' height='120'>
    </div>

Changes in CSS. CSS的变化。

.imgdiv {
    margin: 40px auto;
    position: relative;
    top: 20%;
    left: 5%;
    border: 1px solid red;
    height: 120px;
    width: 100px;
        }

Make the outer div with the same height as the scrollable div, but slightly less wide to not cover up the scroll bar. 使外部div与可滚动div具有相同的高度,但稍微宽一点以不覆盖滚动条。 Make its position absolute. 使其位置绝对。

Insert the image in a div and make the div position relative, and you can move it around. 将图像插入div并使div位置相对,您可以移动它。

I'll bet someone can give us a nice ELEGANT solution. 我敢打赌有人可以给我们一个很好的ELEGANT解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM