本文纯粹是贴出一些比较实用的代码出来供大家学习和使用,也算是个人博客对这些实用代码的记录和收集吧!有用到的可以参考,没用到的直接可以飘过!

特意将这些代码写成jQuery插件的格式,这样方便大家使用的时候调用。我在平时的开发和自我学习过程中也积累了不少有用的代码,不知道怎么概括性地发布出来,所以就已文章的形式陆续贴出来与大家分享。

以单篇文章发布的插件代码都是一些简单的代码,若是一些复杂的代码或插件我会归纳到插件专区里去,这样大家下载起来也方便!

一、插件代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;(function($) {

	$.extend({
		/**
		 * 调用方法: var timerArr = $.blinkTitle.show();
		 *			$.blinkTitle.clear(timerArr);
		 */
		blinkTitle : {
			show : function() {	//有新消息时在title处闪烁提示
				var step=0, _title = document.title;

				var timer = setInterval(function() {
					step++;
					if (step==3) {step=1};
					if (step==1) {document.title='【   】'+_title};
					if (step==2) {document.title='【新消息】'+_title};
				}, 500);

				return [timer, _title];
			},

			/**
			 * @param timerArr[0], timer标记
			 * @param timerArr[1], 初始的title文本内容
			 */
			clear : function(timerArr) {	//去除闪烁提示,恢复初始title文本
				if(timerArr) {
					clearInterval(timerArr[0]);
					document.title = timerArr[1];
				};
			}
		}
	});
})(jQuery);

注意其中调用方法中的timerArr变量,若你在前面调用代码显示了效果,在页面的后面代码中需要清楚该闪烁效果的话,需要注意timerArr变量的作用域。若只是出现效果而无需清楚,则可以直接调用$.hiro.blinkNews.show()

二、调用方法

1
2
3
4
5
6
7
8
9
jQuery(function($) {
	var timerArr = $.blinkTitle.show();

	setTimeout(function() {		//此处是过一定时间后自动消失
		$.blinkTitle.clear(timerArr);
	}, 10000);

	//若人为操作消失,只需如此调用:	$.blinkTitle.clear(timerArr);

jQuery并不像他表面显示的那样,只有那些额定的方法供我们使用。其他在他库的代码内有着很多很酷很便捷的潜在方法,等待被我们发现。在本文中,我将带领你去领略一些我在jQuery库中发现的那些不怎么常见的方法。

1.理解jQuery方法:

当你调用jQuery方法时会发生什么呢?看看jQuery的方法体,非常地简单。

1
2
3
4
jQuery = function (selector, context) {
    // The jQuery object is actually just the init constructor 'enhanced'
    return new jQuery.fn.init(selector, context);
};

在表层的代码之下,jQuery方法(通常称之为“包装”方法)将返回一个实例化后的jQuery对象,即’jQuery.fn.init’构造函数的一个实例。

理解了这一点非常有用,当我们每次调用jQuery方法时,都会返回一个带有一组属性的完全独立的对象。而jQuery的聪明之处在于返回的这个对象是以数组的方式返回的。该对象中的所有元素(通称”集合“)都是由一个数字索引所指向,就像数组中的下标一样。而且jQuery还返回了一个对象的length属性,就像数组中的长度一样。这种思想给jQuery方法提供了无限的想象空间。比如,我们可以从’Array.prototype’中借用一些功能性方法。jQuery中的slice方法就是一个典型的例子:

1
2
3
4
5
6
7
8
9
10
/* ... jQuery.fn.extend({ ... */
slice: function() {
    return this.pushStack(
        Array.prototype.slice.apply( this, arguments ),
        "slice",
        Array.prototype.slice.call(<wbr>arguments).join(",")
    );
},
/* ... */
</wbr>

在该slice方法不管this是否是一个真实的数组,它和其他的元素会和睦地相处,因为有着”length“这么一个属性。

jQuery中还有一些其他有趣的属性,比如”selector”—选择器,”context”—-上下文等。大部分的时候,只需给jQuery方法传递对象参数即可:

1
2
var jqObject = jQuery('a');
jqObject.selector; // => "a"

一个重要的提示是,jQuery有时会返回一个全新的对象供你使用。比如你试图通过执行一段代码来改变一个集合,如”parent()”方法,但是此时jQuery将不会修改当前的对象,它会返回给你一个全新的对象。

1
2
3
4
var originalObject = jQuery('a');
var anotherObject = originalObject.parents();

originalObject === anotherObject; // => false

所有试图改变集合的方法都会返回一个新的jQuery对象,你可以通过”.end()”方法或”.prevObject”属性来访问之前的那个对象。

近段时间来访问我博客的博友们不知是否注意到,博客的一些地方添加了一些增强型Ajax加载效果,用以提高访客的交互和快速浏览不同分类、标签下最新的文章列表。而在今天又新增了增强型Ajax提交评论和回复,只要你留言你就会看到具体效果。

下面我对几处增强Ajax效果进行一下具体说明,大家以后访问我博客时也可以适当地使用。之所以说是增强型Ajax效果,是因为我并没有改变原先的代码,而是在原始代码基础上添加了jQuery控制,这样即使jQuery代码没有加载完成时,你也可以访问到相应的页面。

1.Ajax加载历史文章列表:

在博客的右边有一个最新文章板块,大家可以看到在标题的右边有上页、下页的链接,点击相应的链接便可Ajax加载上下页的文章列表,每次加载10条。图:

2.分类Ajax加载相关最新10条文章记录:

点击博客左边的每个摘要型Post的分类链接、博客右边的分类目录版块链接或者每篇完整型文章的分类链接。会出现一个loading的shadow层,加载完成后罗列出该分类下的最新文章。图:

3.标签Ajax加载相关最新10条文章记录:

点击博客左边的每个摘要型Post的标签链接、博客右边的热门标签版块链接或者每篇完整型文章的标签链接。同样会出现一个loading的shadow层,加载完成后罗列出该标签下的最新文章。图:

4.Ajax提交评论和回复别人的留言:

在此之前,没此提交评论后,当前页面都要重新加载一次,很是耗时。添加Ajax评论后,速度会更快,也大量减少了请求。我的博客一直只提供2层回复。不喜欢多层次回复,看着很难受!具体Ajax评论效果大家只需留言即可看到。

花了精力添加这些Ajax效果,无非是为了让各位博友和来访者可以更加方便地阅读我的博客,同时也希望大家可以多多给我意见。每次添加新的功能我都会在左边的蓝条里写出来,大家可以一目了然地看到我最新的修改信息。

Industrial cleaning is not an easy job to take on. It is a job that suggests you enter into, under, and around places that hold a lot of dirt and crud, whatever it takes to get into it. There is good information for all organizations that have cooking areas, function locations, washrooms, storeroom, and so a lot more. We are here to promise and also help to always make quick work of all your demands as it pertains to industrial cleaning Singapore.

We Have the Right Tools for Any Job

In our toolbox of cleaning up power, we have everything that can perhaps be required to take on any task you have readily available for us. We can bring high-pressure jet washers, boom lifts, and authorized cleansing chemicals. We promise that every product we make use of in your company is safety-approved to make certain that we do not leave more damage than we turn up to repair.

With these tools in our pocket, we can get involved in, around, underneath, and inside of also the tightest and hardest to reach areas. This suggests we can enter into air vents, storage space racks, as well as machinery, or tools that you depend upon. Relying on your company or your certain demands, we may likewise have the ability to walls, ceilings, and also a variety of various other surface areas too.

Why Should Everything Be Deep Cleaned?

Deep cleaning a dining establishment is self-explanatory. If you don’t tidy every part of it, there are a lot of concerns that can make it unsanitary as well as hazardous. It is stunning the number of restaurants burn down due to improperly cleansed grease catches as well as cooktop hoods. You wouldn’t wish to be one more target!

In various other markets, you take the chance of having your service destroyed by fire and also other concerns if you try to skip out on deep cleansing. Dirty air vents can make it challenging for individuals to breathe due to the fact that of dirty air. It can raise allergic reactions and make people experience the whole time that they are in the work environment. It can additionally create you, as a company, to stop working examinations, which might indicate hefty penalties and having to close your doors. Nobody wants that!

We Provide Solutions

With our solutions, industrial cleaning Singapore will never ever be something you need to worry about. We do the dirty work so that you can just deal with looking after your company. We can function around your timetable. All you have to do is provide us an opportunity.

It is vital to take right into consideration the audio hardware if you are planning to update to your very initial luxury sound system at https://www.ohmsound.com/premium-home-cinema-systems/. While it is true that standard border audio speakers are constantly the top option, for some people a way of life loudspeaker such as a soundbar is simply what they need to delight in a truly fascinating movie experience. One of the best features of this audio gadget is that they are able to supply the exact same top quality of a traditional border audio speakers in a portable plan, with configuration being fuss-free as well as being very suitable with the current innovations in residence movie theater systems.

One important feature worth anticipating when it pertains to mounting a way of living loudspeaker together with your reputation home movie theater system is that it can act as a main hub for all of your multimedia devices. Whether you are attaching your Blu-ray player or the current video gaming console, these will all attach straight to your speaker, as well as will be the only equipment that’s linked to your TELEVISION. This makes it less complicated to manage all your gadgets and also most of its functions, specifically when you just need to utilize one remote to do the controlling.

If you are a songs fan and you are looking for an all-in-one songs solution that you will certainly not regret, then the addition of a way of living speaker in your costs home cinema system is something you should think about. With this committed sound gadget, you can easily connect using Bluetooth as well as this enables you to comfortably stream your favorite music from your smartphone – whether it’s from Spotify, Apple Music, and even from your personal saved playlist. Some costs models additionally enable link to your residence WiFi network as well as this gives you the capability to control your speaker from virtually any kind of location in your home simply by using your smartphone.

If you want to take points a step additionally with your stereo, see to it you upgrade with the addition of a wireless back surround audio speaker collection. In the true spirit of the motion picture experience, your luxury sound system will certainly enable you to be involved in the center of all the activity, listening to the music and sound from nearly every direction. If you really feel like you are really component of what is occurring in front of your screen, it’s as. Wireless back border audio speakers are normally included on high-grade lifestyle speaker versions; with power coming from integrated batteries as well as billing from its connection to the major speaker dock itself.

One more benefit of a high-end stereo is the capacity to upgrade your audio with the enhancement of a subwoofer speaker. Since you want a residence theater system that gives you a rich cinematic experience, having this subwoofer provides you that much needed bass that you can truly value, specifically when you are viewing science fiction or activity flicks. A lot of the way of living loudspeakers offered on the market today feature a built-in subwoofer out link so that you have the ability to purchase a compatible model or enable you to just utilize one you already have.

Audio gadgets such as way of living speakers can be found in a least-bulky plan – this implies you don’t have to tension on your own over which cords or wires go where, or which buttons does what. Most recent models just utilize two cables, one for power and also one more for attaching to your TV. A fundamental version can give you with a 2-channel audio speaker system, however if you desire a legitimate deluxe sound system, you can pick high-end versions that have 5 to 12 audio networks integrated for the most immersive cinematic experience possible. Connections could not be simpler with choices to link through Bluetooth, digital optical in, or the ever-evolving HDMI input.

You can discover maternal trousers at stores or online. When you browse the web you will locate that there are various brands and also designs to choose from. The trick is to do your research and try on different styles as well as brand names to make sure that you know what fits you finest. You will certainly be able to try on several different styles, brand names and also colors of maternity pants before making a decision when you go shopping for maternal jeans online. You must also check out what styles and also brand names of pants you such as so that you know exactly what fits you best. The majority of maternal denims come in elastic textiles, so you can be certain that if you require a little added area, you can get it. You can additionally get a pair of pants that are so long that you will certainly be able to fit both your infant and also on your own right into the pants and also not simply your baby.

You must constantly make sure that they are made of a top quality product when you choose your maternal denims. You may end up with a set that will fall apart after just a few months if you choose a set of pants that are not made of top quality textile. An excellent pair of maternal trousers is a pair that has been made with quality materials that will last and that is comfortable. Since this will make certain that you will be able to zoom them up when you require them, you need to additionally look for sets that have actually built in zippers- Shop For Stylish Maternity Bottoms at TeNurse

Do you require to purchase maternity trousers? You need to see to it that you are buying the very best trousers to fit you and also your child as this will certainly make you feel better and also a lot more comfy. When you acquire these pants for you and also your infant, they require to be made from product that is light and also simple to move in and out of. If you have actually gotten to the stage in your maternity when your pants aren’t fitting right and they don’t have sufficient room for your belly to increase, it might be time to purchase some good pregnancy pants. Pick pregnancy pants that fit well and that provide lots of area for your body to grow. The pants that you pick on your own as well as your baby should have flexible legs to make sure that they can be made into a pair that is ideal for you and your child.

You don’t require to spend a significant quantity of your cost savings just to give your house the best interior decoration it can get. As long as you are able to get in touch with a seasoned as well as reputable interior design firm, you have nothing to stress over. You need to be able to locate one that will supply you interior design solutions at an extremely competitive cost if you will make careful analyses.

Imaging yourself coming house to a home that has a relaxing ambiance and also offers you a relaxing experience– don’t you assume it has to do with time you revamp your house so that it will be a much more pleasing area to be in? Must you decide to give it a go, after that employing an interior decoration firm will certainly be the very first order to service.

Before you even enter the choice and analysis phase of a specific interior design firm in Singapore, guarantee first that you recognize just what type of outcomes you wish to obtain for your home. You will certainly be far better off functioning with a company that specializes in that kind of style if you are right into modern interior designs.

You can do your looking for the best interior design firm in Singapore in yellow pages, yet you can not make the right selection by selecting a random name from the list– your best choice will certainly be to find up with a small list of companies then researching about each one based on your needs as well as other vital aspects. Business that appear on the first web page of Google search results might be an excellent begin.

The interior decoration company you will be picking must have the right certifications as well as experience for the work– interior decoration is more than just having a creative mind on your side. Their experience is vital in assisting you choose the right products to use for your house as well as providers with the most effective rates, in addition to provide you with an exact amount of time for completing the project.

Since it is important that you feel comfy communicating and functioning with a certain interior decoration business, you will benefit from scheduling a first examination from them. You might use this opportunity to allow them demonstrate their portfolio and examine their deal with previous clients. There’s an excellent chance they can give exceptional outcomes for your house if their designs appeal to you.

When it comes to your water supply, you can not take way too many opportunities. You would like to know that the water entering into your house is risk-free for drinking which all components of you water supply is made to last. This is why it is so essential to raise your water pump’s life expectancy with PUB approved gaskets. Doing so first could conserve you a lot of concerns later.

The Importance of High Quality Gaskets

In addition to, bath time when you have to drag in all that water and reuse water that has actually been bathed in previously. It may have worked at one time, yet that doesn’t suggest we need to make every effort to do it in today’s world. Rather, a better choice is to pick premium quality wells with even higher quality inside components such as the rubber gaskets that produce the strong seal that avoids water seepage. In short, it offers the water that is needed for your house or your service to run effectively.

The cooking area may be the heart of your home, but without an excellent water supply supplying water, you would not appreciate spending you time preparing meals and also such. You would certainly be forced to still head out to the well or the river to gather water by the container lots. Where’s the fun because?

Alternative Options?

You may be asking suppose it isn’t Public Utilities Board authorized? Or a selection that is accepted by the Public Utilities Board. The reality is you shouldn’t utilize it. When you pick anything else, it may not be suitable for drinkable, or drinkable, water. Primarily, it would benefit flushing a bathroom, however very little else. This kind of makes indoor pipes a little trickier.

Considering the majority of us have a single water line, either from a city well or a nation well, that brings all water into our house, do not you desire it to be as safe as feasible? Functional for whatever you need to use it for? Many people feel that it is that important.

In our viewpoint, and also the viewpoint of most people, finding PUB approved as well as advised products is ideal. It enables you to know undeniably that you are giving your family members with the most effective feasible water to drink. It likewise permits you to know that you are not facing an imminent leakage anytime in the near future.

The net makes it simple for anyone who likes anime to visit a high-grade anime store at www.cosplayo.com. Through these shops, you can expect the softest, most comfortable styles available. All of which will enable you to show your love of this style of apparel easily. It doesn’t matter whether you’re a fan of Naruto, Uchiha, or any one of the other most prominent personalities.

You don’t need to use an anime t-shirt or hoodie with a real personality on it. You might pick a logo or particular colors instead. Anime designs are all about what makes you comfy. You can go just as far as you want to go with it. There are some who merely intend to show their faves. Others wish to clothe the component. What do you want to see on your own in? Or what would you such as to see your kid putting on?

An anime hoodie may have zippers. They might also be sweatshirts with a hood on them. You reach select what you like one of the most or what you think somebody else would certainly like the most. In our point of view, all are quite enjoyable to wear. They order the focus of others, even those who might not such as anime will certainly locate that they are drawn to the bold colors and also impressive, lifelike caricatures.

Show the world what you take pleasure in and be comfortable while doing it. That is the suggestion behind kawaii garments. They enable you to create your very own one-of-a-kind style and afterwards show it off to all who see you strolling down the street. A lot of these designs are affordable as well as look wonderful whether you are sprucing up or clothing down in a style that is distinctively yours. Are you prepared to examine it out?

No matter what you are searching for, there are kawaii clothing options. You can dress for cosplay with wigs, capes, as well as other outfits or accessories. You can clothe for every single day at college and when socializing with friends. These clothing and accessories make terrific presents, however they can likewise be things that you use on your own. The enjoyable of this garments style is that any individual can use it for any kind of reason. It makes a declaration and also sets you in addition to the crowd.

That does not love anime? It is the stuff that today’s kids see around them. They are cutely dressed characters with great hair. Some are brief spoofs and also others are exciting episodes or flicks. Their interest children as well as several grownups is undeniable. Most typically, it is the youngsters as well as teenagers that desire to use their preferred personalities on an anime hoodie. They do it to be cool, however they likewise wear them to express themselves.

The reality is, those who enjoy anime can not obtain sufficient of it. Those that dislike it, wonder what the allure of using garments that have anime personalities on it may be. It is a means for teenagers today to express themselves. Their likes, their favored points, and their favored clothing designs. It shows the things that they enjoy. It incorporates well with the largest trends of today. It is the one where you try to establish yourself apart as opposed to adhere to the group based on just how you clothe as well as what you feel is most comfortable.

Did you understand that there is an anime shop around with the most preferred hoodies and other clothes designs? It is there. There are several high-grade internet sites and stores available that aim to satisfy everybody’s demands. All that individual needs to do is wish to use the coolest clothing readily available. These clothing feature the most popular and also most favorite anime personalities. These hoodies, t shirts, hats, and other cosplay clothing are all assured to make every person delighted.

When you require an occasion space, a workshop could be optimal. These areas can be made use of for conferences, wedding celebrations, therefore a lot more. You can utilize them at any time that you desire a huge room that permits people to hear what is being claimed plainly or when you need to know that sound and also video will certainly come across plainly. Throughout a wedding, you never ever need to fret that somebody being in the back may not have the ability to hear the sacred swears that are being talked. In conferences, you never need to worry that somebody will certainly be left questioning what they missed. It’s a win-win situation for all.

When you think about studio space for rent in Singapore, you will certainly be offered with whatever you need for a successful event. This includes assistance to set it up, the exceptional audio as well as visual gadgets, and a room that is large sufficient for all that are most likely to participate in. For company conferences that run long, you can even expect to have easy access to a lounge, which is fantastic for taking a quick lunch break.

Organizing an occasion always requires a lot of different points. Thankfully, for individuals in Singapore, it is simpler to have every little thing you require without the responsibility to buy everything. It is less complicated to host an event when you have accessibility to a high-quality stereo, audio system, video clip system currently established for you. You can make use of a recording workshop space for rent and have ample to make your occasion, whether company or pleasure, a success.

If you have concerns with any one of the devices or establishing your event, there are additionally people nearby that can assist if you require it. When you make the most of a studio space for rent you acquire a lot of advantages. It is a space that you do not need to go trying to find. You likewise get to have very easy accessibility to as much room as you require and nothing even more. This implies you aren’t spending for wasted room. These studios are soundproof to give personal privacy and also they supply you with an area that is acoustically prepared for whatever you have actually planned.

What kind of event are you intending? Regardless of what your plans are, a studio rental in Singapore is probably the best option you have if you desire a location that is easy to get to for all individuals you are welcoming. In a workshop rental, you will certainly be able to satisfy, socialize, and learn en masse. If that does not satisfy your requirements, you can likewise celebrate in a studio. You can utilize it for any type of event any time. You get to pick what it is most valuable for.

There are studios available in various dimensions. Some can hold just a little team of people. Usually, the smallest workshop offered is one that can hold about 40 people. This is sufficient area to have simply a little group of choosing figures in your company. It might also be a great area for a business award event if you are just most likely to welcome the people that are earning an honor as well as their immediate family.

A studio space for rent in Singapore is best made use of for business conferences, but it can be utilized for a variety of events. The largest studios can hold roughly 120 people, that makes it optimal for smaller sized conferences and events where you do not have a lengthy list of guests. If you are anticipating more individuals, you may require to have a larger space, such as an amphitheater, which can additionally be rented out.

A tape-recording studio area for rent is not just for recording. The bonus offer of renting this room expands much past. It makes it easier for you to tape videos, which can later be utilized as presentations for others within your firm. The high-grade stereo will permit you or your guest speakers to be heard plainly. There are additionally superior visual aids offered to ensure that even presentations can be seen by all who are in attendance.

Purchase Quality Furniture in Singapore

If you ask about, one of the primary factors individuals love on-line purchasing is the potential to locate sale things that they can not find locally. Typically, they save a great deal of cash by searching as well as looking for the products that they desire. You can do the very same. You can search [...]

Read the full article →