我想说明一个正在运行的进度条,而我的页面加载喜欢这里,在我的网页.我在我的示例中使用了一个简单的加载图像,但我想在正在运行的进度条中将其转换.这是我的代码:
$(window).load(function() {
alert("hi");
$('#loading').hide();
});Run Code Online (Sandbox Code Playgroud)
#loading {
width: 100%;
height: 100%;
top: 0px;
left: 0px;
position: fixed;
display: block;
opacity: 0.7;
background-color: #fff;
z-index: 99;
text-align: center;
}
#loading-image {
position: absolute;
top: 100px;
left: 240px;
z-index: 100;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<div id="loading">
<img id="loading-image" src="http://cdn.nirmaltv.com/images/generatorphp-thumb.gif" alt="Loading..." />
</div>
<div id="txt">
<h2>Let AJAX change this text</h2>
</div>
<button>Change Content</button>Run Code Online (Sandbox Code Playgroud)
这是一个JSFiddle
我想增加我的svg图像的高度和宽度,与画布的高度和宽度相同,使它看起来像画布的背景图像.当我按下"设置背景"按钮时,一个svg图像将从我的目录设置为画布.我想动态地将此图像缩放到画布高度和宽度.
预期产出:我想要这个
<h1>canvas</h1>
<canvas style="left: -300px; border: 1px dotted;" height="385" width="400" id="c"></canvas>
<input type="button" id="svg3" value="set background" />
Run Code Online (Sandbox Code Playgroud)
$(document).ready(function(){
var canvas = new fabric.Canvas('c');
var colorSet="red";
$("#svg3").click(function(){
fabric.loadSVGFromURL('http://upload.wikimedia.org/wikipedia/en/c/cd/-Islandshreyfingin.svg', function (objects, options) {
var shape = fabric.util.groupSVGElements(objects, options);
shape.set({
left: 150,
top:200,
//height: 700,
//width: 700,
scaleX: .35,
scaleY:.35
});
if (shape.isSameColor && shape.isSameColor() || !shape.paths) {
shape.setFill(colorSet);
} else if (shape.paths) {
for (var i = 0; i < shape.paths.length; i++) {
shape.paths[i].setFill(colorSet);
}
}
canvas.add(shape);
canvas.renderAll(); …Run Code Online (Sandbox Code Playgroud) 我正在开发一个网站,其中我使用jquery-collagePlus插件来制作图像拼贴.我想在点击随机播放按钮时动态调整图像.任何人都有解决方案(或任何其他方法)然后请让我知道?
这是我的演示拼贴测试
这是我的代码:
$(window).load(function () {
$('.Collage').collagePlus({
'targetHeight' : 300,
'fadeSpeed' : "slow",
'effect' : 'default',
'direction' : 'vertical',
'allowPartialLastRow' : false
});
$('.Collage').removeWhitespace().collagePlus();
});
Run Code Online (Sandbox Code Playgroud)
//的Html
<input name="shuffl" value="shuffle" type="button">
<section style="width:700px; " class="Collage effect-parent">
<img src="../support/images/ed-lea-dribbble-2.png">
<img src="../support/images/ed-lea-dribbble-3.png">
<img src="../support/images/ed-lea-dribbble-4.png">
<img src="../support/images/ed-lea-dribbble-6.png">
<img src="../support/images/ed-lea-dribbble-1.png">
</section>
Run Code Online (Sandbox Code Playgroud) 我想展示时钟有些不同.下面给出的代码对我来说很好.但是我想在用户想要的时候推动和玩这个时间.我想推送和恢复SetTimeout功能.任何人都知道如何做到这一点?
$("#push").click(function () {
});
$("#play").click(function () {
show();
});
function show() {
var Digital = new Date();
var time2 = Digital.getTime();
var time1 = 1403517957984;
var diff = Math.abs(new Date(time2) - new Date(time1));
var seconds = Math.floor(diff / 1000); //ignore any left over units smaller than a second
var minutes = Math.floor(seconds / 60);
seconds = seconds % 60;
var hours = Math.floor(minutes / 60);
minutes = minutes % 60;
if (hours < 10) hours = "0" + hours; …Run Code Online (Sandbox Code Playgroud) 我有两个共享模块“shared-candidate-login-reg.module.ts”和“shared.module.ts”,我在主页中导入了这两个共享模块。我想在我的“WidgetLogRegComponent”组件(它是我主页的子组件,也是我的“shared-candidate-login-reg.module”的一部分)中使用“shared.module.ts”中的“AlertLblComponent” ')。我也在使用延迟加载。为什么我的 Home 模块中没有“alert-lbl”组件?
我的 alert.module.ts
import { AlertLblComponent } from './../directives';
import { AlertService } from './../services/alert.service';
@NgModule({
declarations: [
AlertLblComponent
],
imports: [
CommonModule,
],
providers: [
AlertService,
],
exports: [
CommonModule,
AlertLblComponent
]
})
export class SharedModule {}
Run Code Online (Sandbox Code Playgroud)
shared-candidate-login-reg.module.ts
import { WidgetLogRegComponent } from './../candidates/widget-log-reg/widget-log-reg.component';
@NgModule({
imports: [
CommonModule,
],
declarations: [
WidgetLogRegComponent
],
exports: [
WidgetLogRegComponent
]
})
export class ShareCandidateLoginRegdModule { }
Run Code Online (Sandbox Code Playgroud)
home.module.ts
import {ShareCandidateLoginRegdModule} from './../shared/shared-candidate-login-reg.module';
import {SharedModule} from './../shared/shared.module';
@NgModule({
declarations: [
HomeComponent …Run Code Online (Sandbox Code Playgroud) 我有下面给定的数组作为我的 ajax 响应,现在我想将这些数组值附加到我的 html div 中,为此我已经使用了 for 循环,但出了什么问题?我的输出低于(见附图)
//Array from php page
Array (
[FirstName] => Please enter your first name
[LastName] => Please enter last name
[Email] => This e-mail address is already associated to another account.
[ConfirmPassword] => Passwords do not match
)
//jquery
success:function(result){
for (var i = 0; i < result.length; i++)
{
console.log(result[i]);
$("#error_div").append(result[i]);
}
}
//want this output to append in div
Please enter your first name
Please enter last name
This e-mail address …Run Code Online (Sandbox Code Playgroud) javascript ×4
jquery ×4
css ×3
php ×2
ajax ×1
angular ×1
angular6 ×1
arrays ×1
canvas ×1
fabricjs ×1
html5-canvas ×1
image ×1
lazy-loading ×1
plugins ×1
svg ×1
typescript ×1