如何自动滚动聊天框
HTML:
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex">
<title>College Enquiry Chat</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="assets/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="assets/js/jquery-1.10.2.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript">
window.alert = function(){};
var defaultCSS = document.getElementById('bootstrap-css');
function changeCSS(css){
if(css) $('head > link').filter(':first').replaceWith('<link rel="stylesheet" href="'+ css +'" type="text/css" />');
else $('head > link').filter(':first').replaceWith(defaultCSS);
}
</script>
</head>
<body>
<div class="panel panel-primary" style="border:0px">
<div class="panel-heading top-bar">
<div class="col-md-8 col-xs-8">
<h3 class="panel-title"><span class="glyphicon glyphicon-comment" style="margin-right:6px;"></span>College Enquiry Chat</h3>
</div>
</div>
<div class="panel-body msg_container_base">
<div class="row …Run Code Online (Sandbox Code Playgroud) HTML代码 -
<div class="input-group-btn">
<div id="custom-templates">
<input class="typeahead caret" id="cur1" name="cur1" onkeypress="getData()" class="form-control" style=" color: black;text-transform: uppercase;border: 0px;border-radius: 0px 5px 5px 0px;" aria-label="You Send" type="text" placeholder="BTC" value="BTC">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
Typeahead JS代码 -
var bestPictures = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: 'http://localhost/api/currency.php',
});
$('#custom-templates .typeahead').typeahead(null, {
name: 'best-pictures',
display: 'value',
source: bestPictures,
templates: {
empty: [
'<div class="empty-message">',
'unable to find any crypto currency',
'</div>'
].join('\n'),
suggestion: Handlebars.compile('<div><img src="{{image}}" class="svg"> <strong style="text-transform: uppercase;">{{value}}</strong> – {{year}}</div>')
}
});
Run Code Online (Sandbox Code Playgroud)
输出 -
如输出中所示,图像将添加到下拉列表中.有没有办法在输入框中显示图标?就像点击BTC(见屏幕截图)一样,Image/ICON应该与名称一起添加到输入框中.
我升级了我的android工作室..我在最新版本中发现了很多问题
虽然存在许多类似的问题,但我检查了所有答案,但没有一个对我有效!
这是编译代码时我遇到的错误:
Program type already present: android.support.v4.app.BackStackState$1
Message{kind=ERROR, text=Program type already present: android.support.v4.app.BackStackState$1, sources=[Unknown source file], tool name=Optional.of(D8)}
Run Code Online (Sandbox Code Playgroud)
gradle文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
app gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.guideapp.trickapp"
minSdkVersion 14
targetSdkVersion 23
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
externalNativeBuild {
ndkBuild {
path …Run Code Online (Sandbox Code Playgroud)